- Home /
why I can't pass the param AnimationEvent.objectReferenceParameter,it's always null in even
code is simple just like this:
var evt = new AnimationEvent(); evt.time = eventTime; evt.functionName = eventName; evt.objectReferenceParameter = data; clip.AddEvent(evt);
data is base on UnityEngine.Object.I log objectReferenceParameter in event,it`s aways null.any one know the reason?
Answer by dood2 · Aug 25, 2013 at 05:22 PM
Subclass data from ScriptableObject instead of UnityEngine.Object and it should work.
Your answer
![](https://koobas.hobune.stream/wayback/20220613105915im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
AnimationEvent.objectReferenceParameter being nulled and giving dontDestroyOnLoad issues 0 Answers
(Android)If there are no touches on GUITexture 3 Answers
NullReferenceException: Object reference not set to an instance of an object... 0 Answers
Null reference exception on raycast collider hit? Targetter vs Moving Player 1 Answer
RPC call: parameter suddenly null 1 Answer