- Home /
Question by
JulySellanes · Jan 20, 2018 at 05:36 AM ·
errorscript.transform.positionconstruction
My object does not appear in the proper position
Hi, I'm doing a construction system for my game, but there's a problem, is that when the wall for example, is placed does not appear where I point, well it appears but with +5 in z
My script:
transform.position = new Vector3(hit.transform.position.x, hit.transform.position.y, hit.transform.position.z);
Can somebody help me?
Comment
Best Answer
Answer by KittenSnipes · Jan 21, 2018 at 03:23 AM
So I am guessing you are using RayCastHit to get the position in which the raycast hit but maybe to fully understand where it ends up you can have a preview object show up at the position then if the player presses the key Instantiate the transform of your object at that position.
Your answer
Follow this Question
Related Questions
Critical problem in importing scripts 3 Answers
I am getting a error CS0246: 1 Answer