- Home /
Animation Event for different objects
Hi, this is my first question here. First of all I want to say thanks, this is the first place i come when I have any Unity-related doubt's and so far it has answered all of my questions. Now to my problem:
I recently started using Animation Events and it is pretty much what I'm in need right now. I'm creating an instantiator of objects via animation. So There's an Instantiator object that float on the screen and whenever I want it to instantiate something I've putted an Animation Event calling the right function (via the Animation Tab).
I have one Instantiator for each type of object (InstantiateEnemies, ...PowerUps, ...Asteroids) each one with it's on functions (Instantiate EnemyOfTypeOne, ...ofTypeTwo, InstantiateAsteroid, InstantiateShieldPowerUp, etc).
I could create one animation to each object, but it would not be so simple to know if a object will be instantiated at the right time related to one of another type (for instance "I want an medium asteroid and a tracking-type enemy 2 seconds later instantiated at the same position"). I would have to keep switching between animations in the editor to know if that's the right position.
So I created only one animation that it's the same in all Instantiators. Unfortunately, since the Animation Event works with Messages, it for default requires an receiver. But since I'm not creating via code I don't know how can I tell that the Animation Events I created in the Editor don't require receivers. Because of that, since each Instantiator has it's own functions, I get error messages saying, for instance, that the Asteroid instantiator doesn't have any "InstantiateShieldPowerUp" function.
Any toughts? Any addition details please fell free to ask.
Thanks in advance.
Your answer
Follow this Question
Related Questions
Animation / Distance 0 Answers
how to get a animation from other script on colision 1 Answer
How to call animation from another Script in C#? 1 Answer
Animation problems 1 Answer
How to click a 3d object in unity3d? 3 Answers