- Home /
Animation stops working after SetActiveRecursively()
I am working on a First Person Shooter, and I recently encountered an error after creating a Switch Weapons Script. I can play the Reload Animation before I switch weapons, but after I switch weapons, the entire reloading process stops working. I think it has something to do with deactivating an object, but I'm really stumped. You can download and test the project USING THIS LINK. The entire project and assets so far are included (including the scripts). Thank you.
Answer by HamCoder404 · Aug 21, 2013 at 01:59 AM
I figured it out myself. The problem is Unity's CrossFade and Input function. Basically CrossFade merges the animation with another animation, and the Input doesn't support CrossFading. After being set inactive, the Input stops "working" and you can't CrossFade with it anymore. What worked best for me was simply animation.Play, because the system will just play the animation. I'll leave the download for those who want to play with it.
Hopefully this will be fixed in the next Unity3d update.
Your answer
![](https://koobas.hobune.stream/wayback/20220613112630im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Object.operator bool evaluates oddly 1 Answer
install Animation Riggit 0 Answers
AnimationEvent has no receiver, but there is no AnimationEvent 1 Answer
Animation isnt playing as legacy type. 0 Answers