Hi! I have a animation clip variable in my code. I want my C# code to add an animation event and modify another variable every time someone changes the animation clip in the inspector. My problem is that whenever I modify the variable if the animation clip is open in the animation window it adds keyframes to the animation modifying the variable. I am trying to add an animation event to an animation clip when it is put into my animation clip variable and I want to keep track of that variable in another animation clip variable so that if it is changed(I can check if it was changed by comparing my current animation clip variable to my old animation clip variable)I can then remove the animation event I added to the old/previous animation. Is there any way to do this without adding a property to my animation if that window is open? If adding the property to my animation clip is unavoidable is there anyway I can access the added property in my animation and delete it before the user notices it was added? Thanks for the help
Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.
The best place to ask and answer questions about development with Unity.
To help users navigate the site we have posted a site navigation guide.
If you are a new user to Unity Answers, check out our FAQ for more information.
Make sure to check out our Knowledge Base for commonly asked Unity questions.
If you are a moderator, see our Moderator Guidelines page.
We are making improvements to UA, see the list of changes.
Answers and Comments
7 People are following this question.
How to Serialize an AnimationState
is it possible to save over animation clips and keep events?
Play animation OnTriggerEnter (C#)
Multiple Cars not working