I have a very small scene, with a resting bat that flaps when its collision shape is entered, I want the bat to move in a random direction when it starts flapping, so when theres lots of instances of the bat in a main scene, the bats all fly off in different directions when the collision shape is entered by the player, but not sure where to start to implement this movement part.
Any pointers or ideas anyone?
The actual mechanics would go in the move() function, but this has to be passed back to the physics process function too? Im a bit lost!
func _physics_process(delta):
pass
func _on_Area2D_body_entered(body):
move()
pass
func move():
# fly away.....
pass
At the moment I have a KinematicBody2d (for the movement?) for the main bat scene, with the Area2D as a child using its collision for the body_entered signal.