- Home /
How to access Animation Clip properties via code/Adding and removing animation events via C# scripting
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
Your answer
Follow this Question
Related Questions
Set boolean to false when animation changes? 1 Answer
Modifying script values using animations 0 Answers
problems with pressing a button to run the animation. 0 Answers
Making an Animation pause function in a different game object 2 Answers
Animating multiple objects that should interact with eachother 0 Answers