Move towards with some extras
hello,
I am trying to use a move towards function where a player will go to the exact position of the target. my problem now is one the player destroy the target, the position of the player is a bit off from the original position of the target. (i am controlling the player with a force sensor) how to write a code where the player will go to the exact position of the target that it destroyed?
Answer by Salocin19 · Mar 07, 2016 at 04:33 PM
Instead of moving towards the target itself, make a copy of the target's position. Have the player move toward the target's position rather than the target itself. That way, when the target gets destroyed, the point that the player is moving toward will stay the same.
Follow this Question
Related Questions
Changing transform position - from instantaneous to smooth - not sure how. 0 Answers
how to check when MoveTowards has finished 2 Answers
Trick to move a game object smoothly to left and right 0 Answers
Move rigidbody towards position with velocity property 0 Answers
How to move a GameObject within a Coroutine in C#? 2 Answers