This is great for beginners who are looking i.
Sliding door script unity.
Make an empty gameobject and call it door drag and drop your door model into scene and rename it to body move the body object inside door add a collider preferably spherecollider to door object and make it much bigger then the body model mark it as trigger assign this script to a door object the one with a trigger collider make sure the main character is tagged player upon walking into trigger area the door should open automatically using.
Door opening trigger in unity in this video i show you how to open a door with a trigger pressure plate.
They re a little rougher than my usual ones but here s one of the first few a quick overview of making automated doors for your games.
And in c you ve wanted some new content for a long time so i took an evening to make a few videos separate from unity for the community directly.
Unity 5 doors door unity 5 door doors in unity 5 door in unity 5 don t forget to copy and paste keys from dooropen animation for doorclose animation.
Watch and learn on how to create an automatic sliding door in unity.
Support watchfinddo media on patreon.
All of your doors open because you re not actually checking whether or not the hit object from your raycast is actually the door object your script is holding a reference to.
How to make automatic doors in unity new.
Script lays down here.