Home > Back-end >  Animation event not detecting object
Animation event not detecting object

Time:07-16

I having a little trouble with getting an animation event, to detect my LevelChanger gameObject, as an object. Once I do this, I can select the LoadScene() Function within my LevelChangerScript to load the next scene. However its not possible at the moment as the event wont let my drag and drop the gameObject, into it. enter image description here

CodePudding user response:

Maybe there is a bit of a misunderstanding how animation events work. You have to attach any script to the animator and that script has then to implement a function which you will specify in the 'Function' field in the event. This function should then be called automatically by the animator when playing the animation. The object is just an optional parameter like 'Float' or 'String'.

This might be a good source to read.

  • Related