I have a gun that is underneath a rig layer that is controlling the overall position of the gun. Whenever I shoot I have an animation on the gun that causes a part of it to scale up when a bullet is fired and then scale back down to its original size.
When I play the game the animation will not play when I shoot. I can tab out of the game and click on “Preview” in the Animation tab to preview the correct animation. The when I click “Preview” again to turn it back off the animation will then play for the rest of the time I am in Play mode.
Is there a component to allow this kind of behavior all the time and not just by flipping on and off previewing?
Link to example:
Would be happy to send the project or give any additional information if needed! Thanks!
Hey, are you using nested animators by any chance? e.g. do you have a separate animator for the gun? Running constraints across animators is not something we support. By toggling preview you also reinitialize the gun animator thereby making sure it plays on top. Although this seems to work in the last bit of your video I think it might introduce other issues. Feel free to log a bug if you want us to take a look.
Hello Jebtor, So if you look at the hirearchy I have one Animator on the SM_Charater_Male_01, that is for basic locomotion(running, jumping,etc). The next animator I have is on the one called ----Rig Layers—(which is a child under the SM_Charater_Male_01 object), that is being used for all of the gun stuff (aiming, recoil, reloading).
All of layers under the --Rig Layers__ object have the Rig component added to them and the rig builder is on the SM_Charater_Male_01 object. My reload and recoil animations will play, but the scailing of the sub objects underneath the Rig objeect is where I am finding the problem.
I was wondering could this be an issue of using Humanoid vs Generic animation types? Mine are currently all Humanoid.
I hope I explained that well enough. Thanks for the help.
Possibly, but I suspect the issue here lays in having nested animators. Is there any way you could test this without nested animators, e.g. can you move the gun setup out? Alternatively, you can try Generic animations on the character to confirm your suspicion. Please keep me up to date if you find anything