Hey guys. I want to be able to control a GameObject’s position with my players current facing direction. I already have the code for getting the current facing direction. The GameObject is attached to player already.
The thing is, when I set its position via gameObject.transform.position, it starts moving indefinitely. I just want the position to be set to the value it receives.
For example, when I’m moving up, VerticalDirection value becomes 1. I give this value it to the DirectionArrow using this code in the Update function:
gameObject.transform.position = new Vector3(HorizontalDirection, VerticalDirection);
The arrow moves like the character. How do I make it move to the point and make it stay there?
Sorry for my English, tried my best to explain what I want to do.
Edit: My bad, using rotation was what I actually needed to do.