Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

How to open and close doors / A guide for architects

Discussion in 'Community Learning & Teaching' started by Voltran, Aug 23, 2014.

  1. Voltran

    Voltran

    Joined:
    Aug 23, 2014
    Posts:
    2
    Guys,

    I imported my building model into unity. With a quick workaround i can walk around and climb stairs, explore other floors etc. But i have a problem. When i make all the building as a mesh collider, i cant enter the rooms. When i don't im just running around like casper penetrating all the walls. So i need my doors to be opened and closed after a while automatically. The trigger should be my char which is named as "first person controller".

    How can i do it ? Please give me step by step instructions because i'm a total noob about these.

    Screenshot (5).png Screenshot (6).png
     
  2. SubZeroGaming

    SubZeroGaming

    Joined:
    Mar 4, 2013
    Posts:
    1,008
    To create a open and close door, you can use the Animation window to create it with Ease. Check out the Animation Window in the reference manual, and then write right code that should trigger it to shut and close.

    You can use OnTriggerEnter and or OnTriggerExit
     
    Voltran likes this.