Hello,
Here is my scenario, I have three boxes. Box 1 has the script and the animation. Is there a way to trigger the animation in Box 1, based on the collision of Box 2 and Box 3. One note: when Box 2 and Box 3 collides, Box 2 is destroyed.
Just for more specifics if needed: I have an enemy (box 1), shooting a projectile (box 2), at the player (box 3). Upon the projectile hitting the player, the projectile is destroyed and then I want the enemy to jump up and down excited that he hit the player.
I just need help with the triggering of the animation in this scenario.
I have tried a bool based on OnCollisionEnter2D and OnTriggerEnter2D with the projectile and the player, but no matter what I try (which has been many different ways), even though the bool turns true on collision, I can get that bool to register true on the enemy. So I’m guessing this is the wrong way to go about doing this. The only other way I can think of this working is my scenario above, in having the animation trigger based on the collision of two objects (neither of which the script or animation is on).
Any help with this would be great and if you need any other information, just let me know.
Thanks,
Nic