in my scene i have a butterfly flying in random directions. its just a static sprite rn but i want the front of the butterfly to face whatever direction its moving. how do i do this with nothing but its position?
Is this in 2D or 3D? I assume 2D?
Are we talking top down? Iso? Side scrolling?
Might need a few more details to get a better sense of what you are trying to accomplish, because that informs the solution.
This is not true, you have your random direction. Which means you can rotate your butterfly to the direction you intend to move it. The exact solution needs some more details as @KnightsHouseGames said.
And even if there is some unobservable agent moving your butterfly and all you receive is its updated position, you can always track its previous position in your own state, subtract it from current position to find how it moved this past frame, and use that to calculate heading (such as with Mathf.Atan2() and Mathf.Rad2Deg)
oh i hadnt thought of that lol. ill see if i can get its direction and i will also try using its previous frame to get rotation
update: i got it working with the current/previous location method but i barely understand what i did since i have no idea what atan and rad whatever do