This could be done easily enough just by adding a rigidbody. I'd probably make a flapping animation and have an AnimationTree node to manage it. To manage movement, you'd want to add_central_force
(or an impulse, depending on the outcome you're after) feed in the transform.y
so that it applies to the bird's up which you could scale depending on where you are in the animation. You'd probably want a forward force for the thrust too, depends on your game.
For the rotation I'd use _integrate_forces
, something along these lines:
func _integrate_forces(state):
state.transform = state.transform.rotated(angle)
nb. unless you're very good at maths, you'll be opening yourself to world of pain if you try to control the bird's pitch with apply_central_torque
so I'd advise steering clear and using _integrate_forces
as above.