unity in a function I move an object using transform.position, than next (still in that function) I use that new position in a new function... But why my new function still use the old position?
example
test();
{
transform.position(........); // Move the object
check(); // This function wants to use the new position, but in this case, it always uses the old position
}
So I want to move a game object and I make a function to move it using transform.position. I run that function on the update function, however I try to use RaycastHit and I find no object is in that target location yet on that frame. Is transform.position update in the next frame?
Hello.
If you change the position of an object, then you can use that new position. IF I'ts not working on your code is because you are doing something wrong.
Post your original lines of code that are doing that, so we can check them.
Also please, edit your title, your title must be a simple sentence that gives an idea of what is your problem about. The problem must be explained inside the post, not at the title.
Thanks.
Your answer
Follow this Question
Related Questions
How to check if transform.position reaches target.position? 2 Answers
What is the result of adding transform.position and transform.right? 1 Answer
Why Can't I get 2D object to Move? 1 Answer
how do i instantiate multiple object object with line change with for loop. 1 Answer
How do I move the object up when the another object gets on it 0 Answers