- Home /
How do you tigger an animation with a box collider in Unity 4?
I currently have a door that I can open when I press e and close when I press f but i want to limit that for when I get close enough to it. So I have a empty with a box collider that I want to use for the trigger. I get the collider to trigger. I just don't know how to script it with the new animation system in unity. Any help would be great. Thanks.
You would need to have that animation applied to your object through the animation tools (comoponents - you can find them in object inspector of object you want to add anims to). Once this is done, you could use an OntriggerEnter method that established the collision by tag name (best way in Unity methinks) Can I ask, are you using the Game Essentials book?, if so, then all the assets are there to download including anims for door etc so you should have these. what i dont know is oif oyu have already applied the anims to the door object in the outpost (if is game essential book etc)