Using Animator on things other than imported meshes with skeletons

I’m new to unity and was trying some experiments with navmesh and the animation system. Right now I’m trying to create a simple door using a NavMesh obstacle and a Cube primitive (that I’ve scaled out to look door shaped). The idea is that if the user clicks on the cube, the door will swing open.

I’ve used Unity’s Animation system to create animations on my door cube that show it rotating open, rotation closed and holding still in the closed position. I’ve also created an animation controller and added a bool parameter to control the door. The controller starts with the door holding closed. Setting the parameter will play the door open animation. Clearing it will make the door will swing closed again.

I’ve added an Animator component to my door Cube and set its Controller to my door controller. I’ve not set the Avatar because since this animation was created entirely within the Unity animation window so I don’t have one. I also have a script that listens for mouse clicks and changes the state of my parameter for each one.

Unfortunately, the animation isn’t playing. The controller state machine seems to be working fine, since I can see it reacting properly when I view it in the Animator tab while my game is playing. However, the animations that play are not affecting the door Cube primitive. Instead of my door rotating, it just sits there. I’m thinking that I may need to create an avatar somehow, but I don’t know how to do that.

Anyhow, can the animation system be used things like moving the camera/cubes/menus around, or is it strictly for imported rigged models? Any help appreciated.

Looks like I had Static checked. Once I unchecked that, things started working.

1 Like