- Home /
Move object in a 2D arc
I don't quite understand why it's so complicated but I'm just trying to move a 2D sprite in an arc, the object needs to go to a specific position so can't just add force or something so I tried using Itween but hard to move both in x and y with 2 different tweens. Tried combining an animation and tween as well but seem to clash. Any ideas...?
Answer by Eno-Khaon · Apr 27, 2018 at 07:32 PM
"the object needs to go to a specific position so can't just add force or something"
Actually, you can. That's the entire purpose of trajectory prediction.
In that link, I previously gave a pretty comprehensive look at PhysX-based 3D trajectory prediction. Well, part of the process in each case is breaking each Vector down to be 2D, with a horizontal and vertical segment. Box2D Physics might have a few differences in how/when physics are processed that I haven't looked into in full yet (such as how drag is handled), but that only matters if you're looking for a 100% accurate prediction to draw a line or something.
Thanks but I want to avoid overly complicated systems, I mean I don't need physics or calculate drag and gravity when I just want to move an object up and down mainly.
You might want to make it more clear in your question exactly what your goal is, then.
Your question, as it stands, involved arc-based movement, two axes (x and y), and traveling from one point to another, so my response was directed toward those requirements.
If you're looking a solution specifically tailored toward different needs, we need to know what those needs are to be able to offer any assistance.
Well I can't think of what more to add, as I said, I need the object to move from point a to b in an arc in 2D so x and y axis, something simple like Itween or animations. Really isn't much more to add