Hello everybody! I am working on a 2D game right now and I could use a little bit of help. The game does not use any gravity and the objects in question do not have any rotation. What I am trying to do is have it so that when the player clicks on a particular object in the scene, it moves in an arc towards another object which is at the center of the screen. Each of the 2 objects have their own colliders. Right now I have it set up for the object to path towards the central object based on it’s X/Y position being < or > than the central objects position. But that is proving to be a bit buggy and boring. So thus I want to change the movement to an arc to make it more interesting. Problem is I suck at math so I could really use some help on that front, anybody have any ideas?
Squeeee, I hate doing this but…bump. Problem still exists.
You’ll need a bit of math of some kind. The way I’d probably do it, is find the angle and distance to the target object. Then make the moving object have its position calculated as a kind of orbit around that object, except that while the object orbits, the distance of the orbit gets smaller and smaller, and the angle of the orbit maybe moves forward and then backward, using a sine wave like Mathtf.sin() etc so that it first moves around the circle one way a bit, slows, then goes backwards… if you time it right it should arc toward the target I think.
Otherwise maybe you need bezier curves or something.