nice to find a tutorial a total amateur like me can digest, so many unity content creators struggle with the "this is all new to me " concept, many thanks
Thank you so so much for this tutorial, I was so desperate, because tackling all that code for the first time can be so intimidating without the proper explanation. You literally just saved my day, thank you.
very nice tutorial, was patient in explaining each step and how to tackle potential issues that may come up in the making of the animation. Very helpful especially since its my 1st time using unity for my project. Like button SMASHED.
When I was younger and just started Unity, I only knew how to use Collision to detect stuff, like, if the player was on the ground or something. However, when it came for me to add doors to my game I struggled because I didn't know how raycasts work. So I decided to use the good old colliders to try to solve my problem. I set up a capsule collider which extended around the torso of my player, shaped like a pill, and used Triggers and stuff to try to open doors. Did it work? Kind of. Was it good? Absolutely not. You could literally grab ANYTHING out of closed doors, more specifically through wardrobes and closets and cupboards.
In your assets, click on the animation ciips. If you have an animation for opening the door or closing the door, uncheck 'Loop Time'. That means it'll only play once now after the bool is modified; otherwise it wants to loop the animation and it looks off.
Is there a better way of fixing the trigger problem that isn't making it huge? What if you have a floor above and below that floor and something enters the trigger?
Great tutorial! However, I am creating a door prefab. And since the prefab has multiple instances in the level, this code seems to only work for one of them. The rest are doing nothing! Do you have a method to make sure all instances of the door prefab also animate?
Extremelly difficult to complete! What university degree you need first in order to understand Unity? Also where can I find THIS door to import it as an asset? Because I tried with any other and doesn't work
it is 2021 and i couldn't get the script to run on 2020.3.17 i needed to get rid of "windowAnim = this.transform.parent.GetComponent();" and add "public" to the first line that was written then drag the object the scrip was in into that and everything now working this is a good tutorial just i'm not sure if it needs updating
@@drewpriebe5372 I think this is normal. Just place an empty gameobject in the scene where your door is supposed to be and place your door as a child. Then it will still go at 0,0,0, but the 0,0,0 will correspond to the parent's transform. Your animation is a local animation, you are animating that specific door, so you need to do it. Otherwise, the parent object is the scene root and so your object teleports to it at runtime.
Help please... My door is always opened but it doesn't want to close.. I have "Loop Time" deactivated on the Opening and Closing animation. But the On Trigger Exit somehow doesn't work and it's not because of the coding, since I don't get any error in Unity.
@@ramonalders8205 I havent messed with it in a while so sorry if I'm lacking on details. Your character has an invisible hitbox. One of the issues could be that the hit box is just too big for the for. If you make it small, you should be able to go through. That was my issue.
hello, i need help. I have this error : There is no 'Animator' attached to the "Trigger" game object, but a script is trying to access it. You probably need to add a Animator to the game object "Trigger". Or your script needs to check if the component is attached before using it. Can you help me ? Thank in advance.
Thanks for a very nice tutorial :-) Can you make a tutorial that shows: Player Enters Collider- A text message comes up: ("Press E To Activate Door") and when E is pressed the door opens :-) This should only be possible inside the collider And add sound to the door opening and another sound to the door closing :-)
Seriously?? you should have detach the trigger from the door so that it doesn't get animated with it, it's a very basic solution and it might teach your subscribers some very bad coding methods.😶
Omg i literally searched all of RUclips and all of the totorials were like 500 lines of code. Thank you for making this
0:44 Animation
13:36 Script
Coding
13:59
16:11 OnTriggerEnter
18:18 Closing the door
Coding
18:52 OnTriggerExit
19:56 Fixing a problem. Enlarge the trigger
This is such a perfect tutorial. Not so fast. Not too slow. Perfect pace to follow. Thanks a ton!
nice to find a tutorial a total amateur like me can digest, so many unity content creators struggle with the "this is all new to me " concept, many thanks
Been trying to find a good tutorial for doors and couldn't. Thank you for making this tutorial very helpful got my level working!
Thank you so so much for this tutorial, I was so desperate, because tackling all that code for the first time can be so intimidating without the proper explanation. You literally just saved my day, thank you.
i am lookin for the same awnser
very nice tutorial, was patient in explaining each step and how to tackle potential issues that may come up in the making of the animation. Very helpful especially since its my 1st time using unity for my project. Like button SMASHED.
When I was younger and just started Unity, I only knew how to use Collision to detect stuff, like, if the player was on the ground or something. However, when it came for me to add doors to my game I struggled because I didn't know how raycasts work.
So I decided to use the good old colliders to try to solve my problem. I set up a capsule collider which extended around the torso of my player, shaped like a pill, and used Triggers and stuff to try to open doors. Did it work? Kind of. Was it good? Absolutely not. You could literally grab ANYTHING out of closed doors, more specifically through wardrobes and closets and cupboards.
I've been searching for days! i finally did exactly what i was aiming for! thank you for the great tutorial
Great tutorial, thanks. Hope the channel grows as it deserves to...
i have 2 animations that have a transition into eachother. When i modify the bool, its playing the open animation then directly closes. any help?
In your assets, click on the animation ciips. If you have an animation for opening the door or closing the door, uncheck 'Loop Time'. That means it'll only play once now after the bool is modified; otherwise it wants to loop the animation and it looks off.
@@MoreNimrod Just had the same problem and this fixed it, thanks :)!
Thank you Cor Games for this tutorial, its very help
I am having an issue with Animator is not playing an AnimatorController. Does anyone know how to fix this issue?
Great video! I have also made the unlockable door in Unity and my scene is pretty much low poly 😀
Perfect, didnt know this was possible! thought you had to do it in Blender and import an fbx
Such a great toturial! I was lloking up so many videos but none of them worked.
Very cool! Thank you for posting this tutorial.
Thank you so much, this was allot of help to me, keep up 🍀
I have a problem where i get pushed by an invisble opening and closing door but the actual visible object isnt moving at all?
Is there a better way of fixing the trigger problem that isn't making it huge? What if you have a floor above and below that floor and something enters the trigger?
Finally!! Thank You!!!!! Subscribed......
Easy to fallow tutorial. Keep up the good work!
you saved my ass, had to get open doors done for a Project and could not remember for the life of me how to script it.
I found out that our player needed be to added a character controller component in order to trigger the door. Is that true?
My collider is being animated up and down since it is a child of the door. How can I prevent this?
Is there any way to make the trigger just not move? So I don't need to change its size...
Great tutorial! However, I am creating a door prefab. And since the prefab has multiple instances in the level, this code seems to only work for one of them. The rest are doing nothing! Do you have a method to make sure all instances of the door prefab also animate?
14:00 I’m gonna go swim now :)
When you double click the "chest-menu" button you have yo also double click the background button to close it. Anyone has figured out how to fix it?
Great vedio a request for make a vedio how to open when interact a door by clicking "e" and use keycode to open
Extremelly difficult to complete! What university degree you need first in order to understand Unity? Also where can I find THIS door to import it as an asset? Because I tried with any other and doesn't work
Thenks bro ❤
you are a king good sir
it is 2021 and i couldn't get the script to run on 2020.3.17
i needed to get rid of "windowAnim = this.transform.parent.GetComponent();" and add "public" to the first line that was written then drag the object the scrip was in into that and everything now working
this is a good tutorial just i'm not sure if it needs updating
Thank you so much this really helped a lot!
Use on trigger stay for opening and closing door
For some reason, when i start the game, my door teleports to 0,0,0. can i have help
Did you ever figure this out? In scene view everything is perfect, but when I start the game my door also teleports
@@drewpriebe5372 I think this is normal. Just place an empty gameobject in the scene where your door is supposed to be and place your door as a child. Then it will still go at 0,0,0, but the 0,0,0 will correspond to the parent's transform. Your animation is a local animation, you are animating that specific door, so you need to do it. Otherwise, the parent object is the scene root and so your object teleports to it at runtime.
@@ImInfenix oh thx bc my doors are disapearing to thx!!
but it still didnt work
Help please...
My door is always opened but it doesn't want to close..
I have "Loop Time" deactivated on the Opening and Closing animation.
But the On Trigger Exit somehow doesn't work and it's not because of the coding, since I don't get any error in Unity.
i need help tooo, do you know how to fix it now?
@@appelbanaan2633 no, I am sorry
thanks man your best keep going
So my door opens and closes, but for some reason my character doesn't go through the door. Any ideas as to what could be the cause or what to look at?
Nevermind. I didn't realize that the unity Character Controller has what seems to be some kind of built in collider. Fixed.
@@BomberTVOriginal how did u fix it. i am facing the same problem
@@ramonalders8205 I havent messed with it in a while so sorry if I'm lacking on details.
Your character has an invisible hitbox. One of the issues could be that the hit box is just too big for the for. If you make it small, you should be able to go through. That was my issue.
@@BomberTVOriginal thank you verry much. I fixed my issue as well :)
not working: "The referenced scripts on this behaviour "Game obcject "DoorTrigger") Is mising
Have checked is trigger?
What if you want to have more than 1 door?
Duplicate the while thing and rename where applicable
Could you do a short video on that problem
hello, i need help. I have this error :
There is no 'Animator' attached to the "Trigger" game object, but a script is trying to access it.
You probably need to add a Animator to the game object "Trigger". Or your script needs to check if the component is attached before using it.
Can you help me ? Thank in advance.
Try add the doorTrigger to the door Game object not to the Parent object
thank you so much! 😄
Thank you!!!
Thanks!
So Thanks :)
Greeaaaaaaaatttttt!!!!!
TYSM
Thanks for a very nice tutorial :-)
Can you make a tutorial that shows: Player Enters Collider- A text message comes up: ("Press E To Activate Door") and when E is pressed the door opens :-)
This should only be possible inside the collider
And add sound to the door opening and another sound to the door closing :-)
to add a sound just put a underneath "audioSource.Play();" "_doorAnim.SetBool("IsOpening", false);" and "_doorAnim.SetBool("IsOpening", true);"
wow cool video 5 STARS
my visual dose does not show the animator
i have the same problem
Seriously?? you should have detach the trigger from the door so that it doesn't get animated with it, it's a very basic solution and it might teach your subscribers some very bad coding methods.😶
how
@@chknmcnuggers4577 lol this was 9 months ago, i dont remember till i review the video, i can't now 'cause im in my office for Work 😋