So, I'm using Maya to model and animate models for a game that I'm designing in Unity. An animation I want to do is having my character reach for the door, turn the knob, and walk through the door. The Problem? In a game environment, the door and the character are two separate elements.
How I'm imagining going about this is temporarily importing my door object to my character scene and using that to guide my animation, then try and time the character and door opening animations on both objects in Unity.
However, I'm wondering if this is perhaps the most efficient way to do this or is there another method? Yes, I could just have the door opening automatically for the character on a button press, however I consider the act of physically opening the door in my game to be pretty significant.
Can anyone give me insight on a better, more efficient way to go about this?
Replies
You can put an empty gameobject in front of the door. In game, the door opening animation on the player would have him take a step forward, then reach for the door. While he's stepping you quickly (programmatically) slide him into place, so that when he starts reaching he'll grab the handle on queue. You need a door animation that is the same frame length as the player animation, so you can start them at the same time.
The empty gameobject just serves as a marker, so you can quickly get the location in world space.