Hi.
I would appreciate some ideas on how to construct a catapult.
I want it to fire a rock, but based on how long the user has pressed the fire key.
Any Ideas?
Catapult
Re: Catapult
A very direct approach would be to get the strength of the shot from the input (some scalar value), and then apply an impulse proportional to that strength on the catapult's arm at some point on the arm or apply a torque directly. You can use the Entity.applyImpulse method for this. When applying an impulse, keep in mind that the position you specify is in world space, not local space.
The catapult's arm could be held in place by a couple of ball socket joints at the base, coming from each side.
The catapult's arm could be held in place by a couple of ball socket joints at the base, coming from each side.