Hi,
I'm working on the mechanics of a 2D Platformer. I'd like to trigger an animation that is in another scene.
I'm currently working on Springs.
I have a Player Script and a Spring script.
The Springs are Instanced Scenes in the Scene tree (not scripted, just Instanced manually).
I have an animation for the Springs to make them bounce, e.g.
$AnimatedSprite.play("SpringBounce")
I have a Signal from the Spring script to let the Player know he has collided with the Area2D, which the Springs are made up of.
I need to be able to play the Springs animation from within the Player's script.
I have a Function in the Springs script to do the bounce animation e.g.
func springsAniamtion():
$AnimatedSprite.play("SpringBounce")
What data do I need to pass in the Signal and how do I do it?
How do I play the animation with the data from and how do I write it?
I can't find anything specific regarding playing animation using signals from other scripts anywhere online.
Thanks 😉