- Home /
How to combine animation control with custom script based control for NPCs and player to use doors.
Ive been stuck on this one for a few days trying to get it to work. There is an animation the NPCs use to go through doors, the player can interact with doors by clicking on it and moving which should rotate the door open. When the door is open and no changes to the rotation have been made in a few seconds, the script will start to close the door. It seems like animations and user controlled rotation of objects do not like eachother very much and so I must do the closing in LateUpdate, but if I stop controlling that for any amount of time, the door will shoot back to its original rotation even if the animation state has no motion and is not writing defaults. I have to disable the animator and re-enable it for its current rotation to stay and honestly Im not even sure how I have it working right now.
The primary question i suppose comes down to: How can I implement the animated door open, but otherwise have the rotation primarily controlled by script? The model was made by a member of our team in 3ds max and does not directly implement root motion, instead moving a bone under it, so OnAnimatorMove() does not do anything and I dont even know how to begin to fix that whole problem. I am so lost.
Your answer
Follow this Question
Related Questions
Animator trigger keeps retriggering. 0 Answers
Why when creating new animator controller for the character the character is not walking right ? 0 Answers
How can i check if animation has finished playing if the object have no animator attached ? 1 Answer
Animator Trigger Not Working 1 Answer
How to have a collider inactive only during attack animation and not during 'charging' animation? 1 Answer