trying to get and move an object

Lightning1

New member
Joined
Oct 29, 2021
Messages
2
Programming Experience
Beginner
Im trying to get the Vector2 coordinates from a city object, then moving the player object from the current Vector2 position to the new city position, how would i do this?
 
Last edited:
You posted in the general C# forum, but it feels like you are actually talking about a specific game engine or framework. It would help of you told us what that game engine or framework is.

Barring that, in most game engines let you just directly set the position by copying one vector property to the other vector property, and viola, the object has move to that other vector. Of course the effect of this is instant teleportation. If your intent is to do the movement from the original position to the new position, then you will have to compute the intermediate vector points along the allowed movement path.
 
Based on your other thread, I'm assuming that this is with regards to Unity. Moving to Third party products...
 
Please show us your current code where you are getting the position of the city object, and trying to set it on the player object.
 
Back
Top Bottom