OPENING a DOOR using a BUTTON

  Рет қаралды 24,249

SpeedTutor

SpeedTutor

3 жыл бұрын

In this C# Unity tutorial, I show you how to create animations for a door and then using a raycast and scripts to control opening this with a 3D gameobject and buttons!
Playing and Creating Animations: • Creating SIMPLE Animat...
Creating a Crosshair UI: • Creating a Crosshair i...
Door Interaction Kit: • Door Interaction Kit -...
Check out the FREE tutorials here:
Basic Raycast Door: • INSPECT System Tutoria...
Trigger Door: • INSPECT System Tutoria...
Raycast Button Raycast Door - • OPENING a DOOR using a...
Key Open Door Raycast - • OPENING a DOOR with a ...
Hinge Door - • Creating a HINGE DOOR ...
Get all the Scripts, Projects and content on PATREON HERE: bit.ly/SpeedTutorPatreon
Join the Community Discord: / discord
·························································································
🠺🠺🠺Get Access to Scripts, Projects and Premium Content:
🠺 Patreon: bit.ly/SpeedTutorPatreon
🠺🠺🠺Check Out My Puzzle Assets:
🠺 Adventure Puzzle Kit: bit.ly/adventurepuzzlekit
🠺 Safe Unlock System: bit.ly/safeunlocksystem
🠺 Chess Puzzle System: bit.ly/chesspuzzlesystem
🠺 Examine System: bit.ly/examinesystem
🠺 Generator System: bit.ly/generatorsystem
🠺 Keypad System: bit.ly/keypadsystem
🠺 Gas Mask System: bit.ly/gasmasksystem
🠺 Flashlight System: bit.ly/flashlightsystem
🠺 Note & Letter System: bit.ly/letternotesystem
🠺 Themed Key System: bit.ly/themedkeysystem
🠺 Padlock System: bit.ly/padlocksystem
🠺 Phone System: bit.ly/phonecallsystem
🠺 Lever Puzzle System: bit.ly/leverpuzzlesystem
🠺🠺🠺Model Packs:
🠺 PBR Themed Key Model Pack: bit.ly/themedkeymodelpack
🠺 PBR Chess Piece - Key & Fuse Model Pack: bit.ly/chesskeyfusemodelpack
························································································
● Make a donation today: www.paypal.me/speedtutor
● SpeedTutor Unity Store Assets here: bit.ly/SpeedTutorAssetStore
● Other Unity Store Assets here: bit.ly/MyOtherAssets
························································································
● Website: www.speed-tutor.com
● Facebook: / speedtutoruk
● Twitter: / speedtutor
·······················································································
#Unity #DoorAnimation #OpeningDoor #GameDevelopment

Пікірлер: 86
@SpeedTutor
@SpeedTutor 3 жыл бұрын
GET THE ASSET & SCRIPTS ON MY PATREON HERE: www.patreon.com/SpeedTutor Patreon: www.patreon.com/SpeedTutor Join the Community Discord: discord.gg/vnhWy6R Check out my FREE Assets here: bit.ly/381ybzt
@trturki252
@trturki252 3 жыл бұрын
thanks for the tutorial, been needing this for a long time
@SpeedTutor
@SpeedTutor 3 жыл бұрын
I hope it will help! :)
@closetdemon4769
@closetdemon4769 Жыл бұрын
THANK YOU! ive been looking for this for ages
@SpeedTutor
@SpeedTutor Жыл бұрын
You're very welcome! :D
@iansarmiento23
@iansarmiento23 3 жыл бұрын
Alternate Title: 20 minutes tutorial on how to open a door!
@SpeedTutor
@SpeedTutor 3 жыл бұрын
It's probably a really heavy door! :)
@MedicMainDave
@MedicMainDave 2 жыл бұрын
You just saved my life
@SpeedTutor
@SpeedTutor 2 жыл бұрын
Haha! That's no worries at all. What did you need this for?
@MedicMainDave
@MedicMainDave 2 жыл бұрын
@@SpeedTutor I needed it for something that has literally nothing to do with doors😂 A crafting table of sorts! 👍
@SpeedTutor
@SpeedTutor 2 жыл бұрын
Sometimes the concepts apply to lots of other things! Haha, good job! :P
@wizardingstudios6364
@wizardingstudios6364 3 жыл бұрын
Hi, tons of Unreal Blueprint tutorials allows to close a door while it's opening (or the opposite). I found no samples for unity, every time an animation need to finish before to start the new one. Please have you a tip for this?
@StigDesign
@StigDesign 3 жыл бұрын
6:44 tip: on Norwegian KeyBoard i think Scandinavien keyBoard`s the key is: to left of the number 1 on keyboard for the | symbol, right under Esc key :)
@SpeedTutor
@SpeedTutor 3 жыл бұрын
Haha, thanks for the advice! :) Lets hope you save some people too!
@StigDesign
@StigDesign 3 жыл бұрын
@@SpeedTutor hehe yes :D Great Tutorial as always :)
@GammaPON
@GammaPON Жыл бұрын
спасибо папаша, только с тобой получилось сделать это
@SpeedTutor
@SpeedTutor Жыл бұрын
No problem, my friend! :)
@GammaPON
@GammaPON Жыл бұрын
@@SpeedTutor :)
@sososong3438
@sososong3438 3 жыл бұрын
nice
@SpeedTutor
@SpeedTutor 3 жыл бұрын
Thanks very much! :)
@LaughingPoint-d7d
@LaughingPoint-d7d 5 күн бұрын
Please make a video press on click Door open and close system in unity " I'm waiting your video
@keanpatrickalfon4495
@keanpatrickalfon4495 3 жыл бұрын
Hi, i just want to ask if i duplicate the doors would that animate both when raycast hits the original one? and how can i make multiple doors animate differently in just one script? thanks in advance :)
@SpeedTutor
@SpeedTutor 3 жыл бұрын
They would animate separately! :)
@keanpatrickalfon4495
@keanpatrickalfon4495 3 жыл бұрын
can you make a video for mobile platform using ui button on opening multiple doors pls would happy to support you
@wallbrick1
@wallbrick1 4 ай бұрын
they dont seem to be working on multiple doors at once for example im having 2 doors and 2 buttons i a scene but they dotn both work
@SpeedTutor
@SpeedTutor 4 ай бұрын
What happens?
@Chocobo_Kwehh
@Chocobo_Kwehh 3 жыл бұрын
can i use the this same script to make a telephone or a safe? i wanna make a gameobject with many buttons like a piano and each button does a thing like make sound or put a number for a password
@SpeedTutor
@SpeedTutor 3 жыл бұрын
You could do exactly that!
@DextraVisual
@DextraVisual Жыл бұрын
How would I do this with a UI screenspace button mouse click or touchscreen?
@SpeedTutor
@SpeedTutor Жыл бұрын
You could just make the method public and then add the gameobject which has the script. Attach that to the button OnClick(). Away you go :)
@penguinss99
@penguinss99 6 ай бұрын
thanks.helpfull tutorial but I have a quastion how to add sound effect? (for door) ı'm waiting help comment
@SpeedTutor
@SpeedTutor 6 ай бұрын
In the description, I will show you how - I have a tutorial on it specifically :)
@penguinss99
@penguinss99 6 ай бұрын
@@SpeedTutor Thank you very much. I'll be waiting for your new tutorials!
@Nesrak
@Nesrak 2 жыл бұрын
I followed your tutorial but now when I press the button it opens the door then it keeps repeating the opening animation as if you were watching it in the animator. Help? Edit: Nevermind I was able to fix it by making a closedIdle and an openIdle and making their own coroutines for them.
@SpeedTutor
@SpeedTutor 2 жыл бұрын
Awesome work!
@a.j9812
@a.j9812 2 жыл бұрын
Hey man, I followed the scripts to a T with the exception of the button is on “E” instead of Mouse0 (or left click) and I the animations aren’t trigger unsure why that is but the door just won’t move 😂
@SpeedTutor
@SpeedTutor 2 жыл бұрын
This door isn't static, is it? Did you add a debug line to see if it actually runs the code you're trying? Did you add a collider to the object? Just some suggestions to try! :)
@a.j9812
@a.j9812 2 жыл бұрын
@@SpeedTutor hey, when you mean static you mean?? Yup there is a collider I had altered it a few times. I’ve yet to try a debugging line but unsure what line to try (sorry still very new to this)
@SpeedTutor
@SpeedTutor 2 жыл бұрын
In the top right of the inspector there will be a little tick box, if it's ticked. Animation won't play! :)
@a.j9812
@a.j9812 2 жыл бұрын
@@SpeedTutor ah that fixed it thank you
@SpeedTutor
@SpeedTutor 2 жыл бұрын
No worries, glad I could help! :)
@stutiparekh4543
@stutiparekh4543 3 жыл бұрын
I'm getting errors in Unity in regards to the [SerializeField] code... the error says "The type or namespace name 'SerializeField' could not be found (are you missing a using directive or an assembly reference". I got someone to verify my code for any errors and my code seems identical to this tutorial. Any tips?? Thanks in advance
@SpeedTutor
@SpeedTutor 3 жыл бұрын
I can't say without looking at your code, maybe if you paste it here! :)
@Vuldemurt
@Vuldemurt 2 жыл бұрын
That's because you haven't installed all the required workloads in the installer. You probably figured it out already though.
@paulscott3083
@paulscott3083 2 жыл бұрын
How would u use this with new unity input system instead of writing keycode.(what ever key)
@SpeedTutor
@SpeedTutor 2 жыл бұрын
That's pretty tough to write in a comment, I'd recommend you watch a tutorial on KZfaq for it. As that will serve you better, as it's a far far far more complicated process. :)
@nikos5799
@nikos5799 Жыл бұрын
Hello i need your help, im trying to add more doors but anything that i've tried so far are doesnt seem to work.. can you help me out?
@SpeedTutor
@SpeedTutor Жыл бұрын
What happens?
@nikos5799
@nikos5799 Жыл бұрын
@@SpeedTutor i cannot make it work so i made my own script about doors, if you can create a new video with the same script but adding more doors with diferent keys it would be wonderful
@lekojoy7016
@lekojoy7016 2 жыл бұрын
Hello, idk if yiu answer me, but my Unity says *Assets\Scripts\Door Button Controller.cs(19,13): error CS0246: The type or namespace name 'IEnumenator' could not be found (are you missing a using directive or an assembly reference?) * Scripts are the same to you, but IEnumenator doesn`t work
@SpeedTutor
@SpeedTutor 2 жыл бұрын
Do you have errors before or after this?
@lekojoy7016
@lekojoy7016 2 жыл бұрын
@@SpeedTutor no thanks, I saw my mistake, I see that I wrote IEnumenator and I needed to write IEnumerator, xD stupidest mistake
@fangbauble0133
@fangbauble0133 Жыл бұрын
For some rason my crosshair isn't working and i'm not sure how I can fix it??? Great tutorial for everything else though
@SpeedTutor
@SpeedTutor Жыл бұрын
You mean it doesn't turn red?
@EXP256
@EXP256 3 жыл бұрын
nvm fixed it
@SpeedTutor
@SpeedTutor 3 жыл бұрын
You're so fast! :P
@MustafaAbbasi
@MustafaAbbasi 2 жыл бұрын
can you make it so that it works with multiple in a scene
@SpeedTutor
@SpeedTutor 2 жыл бұрын
You can do that! That's what it does! :)
@MustafaAbbasi
@MustafaAbbasi 2 жыл бұрын
@@SpeedTutor Yes,i experimented a little bit and it works. Amazing tutorial!
@SpeedTutor
@SpeedTutor 2 жыл бұрын
Thanks very much, I really appreciate it! :D
@wallbrick1
@wallbrick1 4 ай бұрын
how did you fix it ? @@MustafaAbbasi
@popcornking
@popcornking 3 жыл бұрын
Can we use any version of vs code??? For unity!!
@SpeedTutor
@SpeedTutor 3 жыл бұрын
I think so, but I'd recommend 2017 or above! :)
@popcornking
@popcornking 3 жыл бұрын
@@SpeedTutor I'm using latest version ೨೦೨೧, is it best??
@popcornking
@popcornking 3 жыл бұрын
@@SpeedTutor thankyou for responding❤️ And also thanks for solution 👍 And the gift for you is subscribe to your channel as 2times ❤️
@SpeedTutor
@SpeedTutor 3 жыл бұрын
Thanks! Yes, that's the best option! :)
@alfaaz7146
@alfaaz7146 3 жыл бұрын
I'm Currently Working on an FPS Android Game. Can I get some Level Objective Ideas Please. 🥺 This would be available on Playstore Once it is finished.
@SpeedTutor
@SpeedTutor 3 жыл бұрын
What exactly are you looking for?
@Justin-nw7xi
@Justin-nw7xi 3 жыл бұрын
@@SpeedTutor How To Make Objective System?
@TheBoringNova
@TheBoringNova 3 жыл бұрын
the open animation keeps looping, how do i fix that?
@SpeedTutor
@SpeedTutor 3 жыл бұрын
Select the animation and untick "Loop time"
@TheBoringNova
@TheBoringNova 3 жыл бұрын
@@SpeedTutor oh ok cool. Thank you! :)
@sadiqaga8901
@sadiqaga8901 2 жыл бұрын
can i get script please
@SpeedTutor
@SpeedTutor 2 жыл бұрын
It's on my Patreon! :)
@sm7_633
@sm7_633 Жыл бұрын
my crosshair doesn't turn red and the door doesn't open
@SpeedTutor
@SpeedTutor Жыл бұрын
Any errors?
@sm7_633
@sm7_633 Жыл бұрын
@@SpeedTutor im not getting any errors on the console
@raevod6361
@raevod6361 Жыл бұрын
Pleease give me the script 😭
@SpeedTutor
@SpeedTutor Жыл бұрын
It's on my Patreon if you need it but remember you can watch this video for free :)
@luishamiltonbalem5669
@luishamiltonbalem5669 3 жыл бұрын
didn't work for me :(
@SpeedTutor
@SpeedTutor 3 жыл бұрын
What happened?
@bojanmileski6541
@bojanmileski6541 2 жыл бұрын
Animator.GotoState: State could not be found Help please
@SpeedTutor
@SpeedTutor 2 жыл бұрын
Did you create the correct name when you referenced it?
@bojanmileski6541
@bojanmileski6541 2 жыл бұрын
@@SpeedTutor omg you are right I rewatched whole video and found out that it was open door instead of door open hahaha in animator
@bojanmileski6541
@bojanmileski6541 2 жыл бұрын
@@SpeedTutor thanks!
@SpeedTutor
@SpeedTutor 2 жыл бұрын
Haha, sometimes something so obvious can be the thing that's wrong. I've done it myself! :P Good work.
Create Interactive Doors in Unity Using Chat GPT
17:04
SpeedTutor
Рет қаралды 3,2 М.
3 Hours vs. 3 Years of Blender
17:44
Isto Inc.
Рет қаралды 4,4 МЛН
UNO!
00:18
БРУНО
Рет қаралды 1,8 МЛН
Каха заблудился в горах
00:57
К-Media
Рет қаралды 9 МЛН
Sigma Kid Hair #funny #sigma #comedy
00:33
CRAZY GREAPA
Рет қаралды 39 МЛН
Water powered timers hidden in public restrooms
13:12
Steve Mould
Рет қаралды 707 М.
OPENING a DOOR in UNITY on TRIGGER EVENT
8:20
SpeedTutor
Рет қаралды 110 М.
Can You Farm 1,000,000 Cookies in 100 Minecraft Days?
38:21
aCookieGod
Рет қаралды 12 МЛН
How to ACTUALLY get into Gamedev
14:01
DaFluffyPotato
Рет қаралды 708 М.
How to Become a Game Designer
15:08
Game Maker's Toolkit
Рет қаралды 1,1 МЛН
Make VR DOORS IN UNITY with NO CODE!
8:09
Daniel Stringer
Рет қаралды 11 М.
How to OPEN A DOOR in UNITY - Easy Tutorial
9:28
Kozmobot Games
Рет қаралды 2,3 М.
A* Pathfinding (E01: algorithm explanation)
11:39
Sebastian Lague
Рет қаралды 2 МЛН
UNO!
00:18
БРУНО
Рет қаралды 1,8 МЛН