Hi guys. Trying to move an object when the player enters the trigger box collider of the player. I am trying with transform.translate but it doesnt work on the trigger function. It works but the object moves from point a to b directly and you dont see it. Only when i use void update the object moves and you can see it move from point A to B the entire way. So my question is how can i move the object from A to B on trigger enter 2D see being able to see the path that the object is taking when i play the game and not have the object instantly move from point A to B. Thank you.
Generally since the trigger just happens once, on a single frame, you would make note of it happening, and then use Update or a coroutine or navigation or whatever to make the movement.
This can be done by having a boolean that says “go to destination now” and clear it initially, then set it when the trigger happens, and in update say “should I be going?” by checking that boolean.