Player's drag to control orbit around a point
justinodunn
Member, PRO Posts: 226
Hi, so I'd like to create an actor that orbits around a point based on the player's drag motion. So if the player drags and holds the actor towards the right side, the actor orbits to that direction around the point, however still following that "fixed" path around the point. Any ideas?
Comments
Like this:
You drag the turtle around the circle, and no matter where your mouse goes, as long as it's greater than or less than its current x position, it will continue to either direction based on the player's drag movement.
Here is an idea I have:
Use vector to find angle between mouse position and centre object
If angle between mouse and centre is greater than angle between rotating object and centre, then activate orbit
If angle between mouse and centre is less than angle between rotating object and centre, then activate orbit in opposite direction
Would this work?
EDIT: I'm using the orbit formula from this video
Meaning that the orbit would only happen at a certain speed when triggered, rather than orbiting based on the player's drag movement (speed).
Nevermind, this thread helped me
http://forums.gamesalad.com/discussion/32436/follow-mouse-constrain-to-circle