OPENING a DOOR in UNITY with a RAYCAST

  Рет қаралды 55,004

SpeedTutor

SpeedTutor

Күн бұрын

Пікірлер
@SpeedTutor
@SpeedTutor 4 жыл бұрын
Lets cast a spell on this door and open it up! Who's with me? :D 🔥UNITY SAVINGS: bit.ly/UnitySalesHub 🔥SpeedTutor Unity Store: bit.ly/STUnityStorePuzzlePacks 🔥HUMBLE SAVINGS: bit.ly/HumbleBundleDeals
@clericnorsegaming173
@clericnorsegaming173 3 жыл бұрын
Such a good tutorial..... Literally I have spent 10 hrs and watched a totally of 30 tutorials to get my dang door to open.... NONE OF THEM WORKED UNTIL I FOUND YOURS! My only problem is my animations are not showing up the door will open knocking my player out of the way but the doors in the exact same spot XD atleast now I can walk into my town :D So Ill have to figure out why my animations aren't working!
@II-or8pw
@II-or8pw 4 жыл бұрын
Thank you, learning unity right now and this helped a lot for a group project i have in school, really easy to follow and very clear to understand, thank you !
@SpeedTutor
@SpeedTutor 4 жыл бұрын
I'm really glad you liked it! :)
@h38-m9e
@h38-m9e 3 жыл бұрын
Great method. However, one slight issue is that you can spam click your open/close key to trigger the animation. I fixed this by adding two animation states; open and closed- both obviously having an idle position for the closed and opened door. Then, I check to see if the door is in one of these animation states before opening/closing the door: if (yourAnimator.GetCurrentAnimatorStateInfo(0).IsName("opened") || yourAnimator.GetCurrentAnimatorStateInfo(0).IsName("closed") { //Open & Close your door } Hope this helps!
@SpeedTutor
@SpeedTutor 3 жыл бұрын
That's great to hear! I did make an update to my "Door Interaction Kit" which has an example of how to stop being able to spam the animations, I think I even updated this in the recent door videos too! :) Thanks for the suggestion though!
@stingandr
@stingandr 2 жыл бұрын
where do i paste that? in what line of the code?
@HardPlay-iv2fm
@HardPlay-iv2fm 13 күн бұрын
Awesome video!!! Thank you so much! Everything is explained and shown in detail. All the best!!!🙌
@SpeedTutor
@SpeedTutor 13 күн бұрын
I'm glad you've found it useful! :D I hope to see you around on the channel again.
@dragonanimations0748
@dragonanimations0748 11 ай бұрын
THANK YOU SO MUCH FOR MAKING THIS TUTORIAL... IVE BEEN LOOKING FOR SOMETHING LIKE THIS FOR HOURS 😭😭
@SpeedTutor
@SpeedTutor 11 ай бұрын
You're very welcome! :D I have a full asset on the Unity store for this type of thing with full customisation.
@dragonanimations0748
@dragonanimations0748 11 ай бұрын
@@SpeedTutor would i be able use this tutorial multiple times in one setting? if so would I have to make a new script per object even if they have the same animation. For example, I'm currently working on making a target shooter game and have been struggling with making the collapse animation play when the target is shot by a raycast. I've been able to get this code for one target, though it gets a little finicky at times, I've been having trouble applying the code to multiple targets. Any suggestions?
@EnriqueIMMontemar
@EnriqueIMMontemar 2 жыл бұрын
it's not necessary to make 2 animations for the door, you can just copy the open animation in the animator and put the speed as -1
@SpeedTutor
@SpeedTutor 2 жыл бұрын
Great advice, I realised this in my more recent examples of opening doors. I do show that in my other animation style tutorials, thanks for sharing though! :)
@WardenMilkman
@WardenMilkman Жыл бұрын
I spent 4 days trying to figure it out but after your tutorial it worked 👍🏻
@SpeedTutor
@SpeedTutor Жыл бұрын
Awesome, I'm glad I could help you out! :D How did you find my tutorial?
@Old.Badger
@Old.Badger 3 жыл бұрын
Thank you very much, I don't know how I can repay you more than by liking and taking subscribe, I was looking for a tutorial on the door for several hours and you described it best and most functionally.
@SpeedTutor
@SpeedTutor 3 жыл бұрын
You're most welcome! Good luck! :)
@lifeinthehands6972
@lifeinthehands6972 2 жыл бұрын
@@SpeedTutor Thank you for the video bro. But I want to make this at mobile devices. How can I set the mouse0 button. I have to do it with Touch input.
@pabloperezmartin1906
@pabloperezmartin1906 4 жыл бұрын
Great tutorial! Could you explain briefly how to set the intermediate script so we can use several objects with different uses? That would be just fantastic if you could. Thankss from spain
@aus_bot9899
@aus_bot9899 4 жыл бұрын
The code is good now I thinks but whenever i try to change the tag the right ones aren't there
@SpeedTutor
@SpeedTutor 4 жыл бұрын
You can add new ones
@fraiva22
@fraiva22 11 ай бұрын
when do we write the doorcontroller script. its referenced in doorraycast
@parthacodes5893
@parthacodes5893 Жыл бұрын
Thanks a lot it helped in my project most of stuff dont have doors only the palace has it
@SpeedTutor
@SpeedTutor Жыл бұрын
Great to hear it, thanks for checking this out! :))))
@dariusjackson1960
@dariusjackson1960 2 жыл бұрын
THANK YOU, MY FINAL ASKED ME TO DO THIS. U SAVED ME
@SpeedTutor
@SpeedTutor 2 жыл бұрын
I'm really glad I could help you out! :D
@hh5559
@hh5559 Жыл бұрын
I typed out the exact code as you, but for some reason, every time I try going near the door, it keeps bringing up a bunch of errors in the console saying 'Tag: InteractiveObject is not defined', despite there being no errors in the code. The crosshair shows up fine but won't let me click and open the door.
@SpeedTutor
@SpeedTutor Жыл бұрын
That suggests you haven't set the tag in the top right of the inspector :)
@gmangman123
@gmangman123 2 жыл бұрын
very good tutorial! I use this method for shooting with raycast ammo crates break!
@SpeedTutor
@SpeedTutor 2 жыл бұрын
Oh awesome, good job! :D
@rave_gamez5963
@rave_gamez5963 4 жыл бұрын
hey speed tutor thx for this tutorial but i have a error whenever i click on the door it keeps playing the open door animation like i can close it but it still plays out the open animation
@SpeedTutor
@SpeedTutor 4 жыл бұрын
Is this error from the tutorial on my pack online?
@frankdekorte1901
@frankdekorte1901 4 жыл бұрын
Hi, thank you fot the tutorial but I am getting the warning: Animator.GotoState: State could not be found UnityEngine.Animator:Play(String, Int32, Single). Could you tell me what I should do?
@frankdekorte1901
@frankdekorte1901 3 жыл бұрын
No, not yet
@Shad0wWarior
@Shad0wWarior 2 ай бұрын
@@frankdekorte1901 you found how to fix?
@synth3tic256
@synth3tic256 2 жыл бұрын
I cant add the DoorRaycast script onto the Camera and it Says because the script class cannot be found.
@SpeedTutor
@SpeedTutor 2 жыл бұрын
Is the script name the same as the class name?
@pounceroreo2
@pounceroreo2 2 жыл бұрын
I have this same issue. Tried yesterday.
@synth3tic256
@synth3tic256 2 жыл бұрын
It does but it still says the same thing.
@SpeedTutor
@SpeedTutor 2 жыл бұрын
You fixed it?
@EnzoGOAT
@EnzoGOAT 4 жыл бұрын
Thank you SpeedTutor ! :)
@SpeedTutor
@SpeedTutor 4 жыл бұрын
No problem at all! :)
@rave_gamez5963
@rave_gamez5963 4 жыл бұрын
many people don't appreciate his tutorial
@SpeedTutor
@SpeedTutor 4 жыл бұрын
I hope you appreciate it! :)
@tesoro23b
@tesoro23b 2 жыл бұрын
is it possible to make this script universal? that is, not only for the door, for example, for a pull-out shelf?
@SpeedTutor
@SpeedTutor 2 жыл бұрын
Of course, you'd just play the animation on the drawer instead of playing the door animation! :)
@tesoro23b
@tesoro23b 2 жыл бұрын
@@SpeedTutor thanks)
@Luuynix
@Luuynix 2 жыл бұрын
can i add a cooldown before i use the door again? Because if i keep spamming it just repeats the animation in the middle of the other animation
@SpeedTutor
@SpeedTutor 2 жыл бұрын
Yes, I do actually have a cooldown in one of my more recent door opening videos. Maybe the key one? :)
@Luuynix
@Luuynix 2 жыл бұрын
@@SpeedTutor Ok i'll check it out
@tesoro23b
@tesoro23b 2 жыл бұрын
is this way of opening the door the same as in granny, outlast, hello neighbor?
@SpeedTutor
@SpeedTutor 2 жыл бұрын
How do those work?
@tesoro23b
@tesoro23b 2 жыл бұрын
@@SpeedTutor yes
@JustinJ29
@JustinJ29 4 жыл бұрын
So can you please explain how to let the animation finish first before you could close the door. I have been searching for solution but its to complicated for this code. I think that the only issue. Please help thanks
@SpeedTutor
@SpeedTutor 4 жыл бұрын
You can download my "Door Interaction Kit" and there is an example in there for you! :) I updated it since this tutorial!
@dcry1003
@dcry1003 2 жыл бұрын
hey just wanna ask can this also be applicable without the use of a mouse click? like with just a raycast after finding a gameobject with a specific layer it would trigger the gameobject specific action?
@SpeedTutor
@SpeedTutor 2 жыл бұрын
You could, just remove the input part and it would activate the action without it :)
@あかたなまは
@あかたなまは Жыл бұрын
Thanks for the great tutorial. I am typing this text with automatic translation, so I apologize if some parts are incorrect. I was able to get to the point where I could open and close the door with your tutorial, but I am having trouble with the door hit detection and it just slides through. If you could please tell me how to solve this problem, I would appreciate it.
@SpeedTutor
@SpeedTutor Жыл бұрын
Can you explain a little more, it slides through? As in doesn't detect the door? :)
@あかたなまは
@あかたなまは Жыл бұрын
@@SpeedTutor Thank you for your prompt reply. I have already solved the problem I mentioned earlier. So, one question: may I sell the game that implements the door feature that I made based on your tutorial on steam and other sites? In a nutshell, "May I use it for commercial purposes?" This is what I mean.
@SpeedTutor
@SpeedTutor Жыл бұрын
Yes, absolutely. You're free to use them, as long as you don't sell it by itself. If it's part of a game, that's fine :)
@あかたなまは
@あかたなまは Жыл бұрын
@@SpeedTutor Thank you so much. We will introduce you in the credits of the end roll of the game.
@FoxGAMING-NTF
@FoxGAMING-NTF 4 жыл бұрын
I can't seem to be able to get this to work for me, the crosshair will never change, either. I tried getting your Free Door Interaction Asset on the Unity Asset Store, and it would work for the prefab doors, but not for what I'm trying to use it on/ for, which is a trash can door. It's supposed to be so that you can look at the door, and then left click on it to open / close the door / lid. Edit / Update: Ok, so I'm just dumb, all I needed to do was make the Box Collider a bit bigger. Another Edit: Ok, Maybe not, I can't get it to work again anymore. Another (Hopefully, I guess, Final,), Update: Ok, so I think it actually is that. It (the Box Collider,), has to be the height of my player or something, in order for it to detect it. I guess, in this case, is there a way to make it be so that I don't have to make the Box Collider so big that it will obstruct other collisions? The trash can in question (and all of them, probably, for that matter,), have another box collider for being able to drag the trash can around, and this Box Collider, with the fact that it has to be so big, means that it collides with the box collider for this. Plus, it makes the spot you have to look at the trash can door / lid for very unrealistic / inaccurate / big.
@SpeedTutor
@SpeedTutor 4 жыл бұрын
I'm not really sure what to suggest because I've never had to make the box collider bigger than the player, you can normally do it on a tiny little object. Are you using it in a first person style?
@FoxGAMING-NTF
@FoxGAMING-NTF 4 жыл бұрын
@@SpeedTutor Yes, I'm trying to make / use a full-body FPS Setup. I'm using FirstPersonAIO (First Person All-in-One). It seems, that the collider has to be the height of the player, or at least, up to the height of the player camera.
@FoxGAMING-NTF
@FoxGAMING-NTF 4 жыл бұрын
@@SpeedTutor I'm also trying to figure out how to make the player character's head move with the camera. Currently, I have the player camera as a child of the DEF-head bone, and the head bone has a script attached to it to make it follow the camera, but it makes the camera jitter, shake, and wobble, quite a lot. And, it seems as if the camera moves at a different, faster speed than the head, and the head can twist too far. It only makes the head move up and down, since because I think it's since I'm using the FirstPersonAIO System, and I have the player character mesh as a child of the FPSAIO Controller, so it rotates the body left and right when you look left and right. But still, there needs to be a limit to the angle of rotation that the head can make, and I need to figure out a way to make the camera and head move at the same speed, and look at the same angle.
@ericmiyan3466
@ericmiyan3466 4 жыл бұрын
i dont get any error but the animations just wont play even when i set open door to default the door doesnt move
@SpeedTutor
@SpeedTutor 4 жыл бұрын
Does the animation play when you try it in the inspector?
@tranceemerson8325
@tranceemerson8325 3 жыл бұрын
this tutorial has a lot of extra stuff I don't need. like the crosshair stuff... is there a version of the code that doesn't deal with that?
@SpeedTutor
@SpeedTutor 3 жыл бұрын
You can just delete those lines! :)
@danielfenton1686
@danielfenton1686 2 жыл бұрын
7:47 Can someone help me please? When doing the "Raycast hit;" part of the code, the word 'Raycast' automatically turns to 'RaycastHit' and when I then delete the 'Hit' part, the word 'Raycast' remains in white text. Why is this? It appears it doesn't have a Raycast to reference.. Am I missing something here?
@SpeedTutor
@SpeedTutor 2 жыл бұрын
What does your code look like?
@yoko3021
@yoko3021 2 жыл бұрын
It's supposed to be RaycastHit hit; he corrects it a minute later.
@gasparo8907
@gasparo8907 7 ай бұрын
I had my doors marked as static for light baking purposes. Doors won't move when marked static...
@SpeedTutor
@SpeedTutor 7 ай бұрын
That's right, if it's static it won't move at all. You need to make sure they're not because it's for things that never move :)
@gasparo8907
@gasparo8907 7 ай бұрын
​@@SpeedTutor Great tutorial.
@SpeedTutor
@SpeedTutor 7 ай бұрын
Thanks very much :)
@spiderdlh9905
@spiderdlh9905 3 жыл бұрын
Hi im getting this message The referenced script (Unknown) on this Behaviour is missing! and no animation just allows me to walk through the door
@SpeedTutor
@SpeedTutor 3 жыл бұрын
You could download my pack from the store and check it against yours, that might be helpful? :)
@TomFowkes
@TomFowkes 3 жыл бұрын
most of it worked for me except two things, at 16:16 there was no option for InteractiveObject in the dropdown menu for the tag and at 16:40 there was no option for 'Interact' on the dropdown menu for the Layer Mask Interact. great tutorial though, and it would be very appriciated if you could help with my issues. thanks
@SpeedTutor
@SpeedTutor 3 жыл бұрын
You need to create those tags and/or layers yourself via those dropdowns by "Add tag"! :)
@ax4mineshaft844
@ax4mineshaft844 9 ай бұрын
Hi, where did u get ur FPSController and MainCamera game objects from? I have followed the tutorial closely but mine doesnt work. (Crosshair unresponsive, animation and door not interactable) I got my FPS controller from the unity asset store but it looks different from yours. I suspect that I have attached my scripts to the wrong objects.
@SpeedTutor
@SpeedTutor 9 ай бұрын
It's the Unity standard assets but controllers are built slightly different depending on what you've got hold of :)
@ax4mineshaft844
@ax4mineshaft844 9 ай бұрын
@@SpeedTutor Would the FPSController in this video be the same as the one in ur FPS controller tutorial 2 months ago?
@bmpproductions
@bmpproductions Жыл бұрын
This probably has a simple answer, but... I really need to know how to get multiple doors and objects to have their respective animations work when clicked on. Example: I have multiple working doors but I have another object with cabinet doors that have different animations. Would that be able to be accessed through the DoorController script or will I need to make a separate one for that. If you can, explain what I could do here, please and thank you.
@SpeedTutor
@SpeedTutor Жыл бұрын
I can't fully remember how I coded this but the best way is to create one script which controls playing animations or use "Events" so you can play specific animations on objects with one script. You can check out my tutorial on events, this means all objects have the same script but like UI buttons, have events where you can do whatever action you want :)
@saihou1280
@saihou1280 Жыл бұрын
what i did was use the same raycast code but change the controller
@bmpproductions
@bmpproductions Жыл бұрын
@@saihou1280 I eventually just made a [serializedfield] for the animation names and just input the names of each type of animation into the inspector. That was like the first thing that came to mind to fix my problem.
@marik996
@marik996 2 ай бұрын
How did you learn to make games and make programs that do this i copied your code word for word and the door works but im just wondering how you got to the point where you know how to do this thanks.
@SpeedTutor
@SpeedTutor 2 ай бұрын
Just take an idea that you want to do and break those down into small steps. Research how to do them and build up your experience as you go along :)
@marik996
@marik996 2 ай бұрын
@@SpeedTutor thanks really appreciate the response
@miracube4452
@miracube4452 3 жыл бұрын
hey, I've followed your tutorial exactly how you did it, but nothing works. no errors or anything, all scripts are attached, but my crosshair doesnt change colour nor can i open/close the door. do you have any ideas as to what might be the problem?
@SpeedTutor
@SpeedTutor 3 жыл бұрын
I'm not sure at all, you could download the pack from the store and check it against yours? :)
@hsmyv
@hsmyv 3 жыл бұрын
same problem(
@Dan-ed1sk
@Dan-ed1sk 3 жыл бұрын
me too
@xEVANcMAN
@xEVANcMAN 3 жыл бұрын
Same
@dogepauwa2770
@dogepauwa2770 2 жыл бұрын
@@SpeedTutor I like how you make a video about something and when someone says they have a problem you tell them to buy ur shit? absolute sellout unsubscribed.
@wecontrolyourinsanity1378
@wecontrolyourinsanity1378 Жыл бұрын
This really helps and is great but one small issue I have is that why does my animation for closing the door and opening the door keep on looking even though loop time isn't checked?
@SpeedTutor
@SpeedTutor Жыл бұрын
You're sure that loop time isn't on for specific animations? You don't have multiple, do you?
@wecontrolyourinsanity1378
@wecontrolyourinsanity1378 Жыл бұрын
​@@SpeedTutor Thank you so much
@iakacer
@iakacer 4 жыл бұрын
Amazing tutorial, I'm having issues with the crosshair part, I've changed to a text "[E] Open Door", and the text kept flashing somehow, it is the same with the crosshair color too.
@SpeedTutor
@SpeedTutor 4 жыл бұрын
In what way do you mean flashing?
@iakacer
@iakacer 4 жыл бұрын
@@SpeedTutor For example, in your demo with the original script, the crosshair is flashing red instead of a static red crosshair when aiming at the door.
@SpeedTutor
@SpeedTutor 4 жыл бұрын
That's strange, did you write the correct if statements within the update method? You could download my pack and see for yourself! :)
@iakacer
@iakacer 4 жыл бұрын
@@SpeedTutor Thank you for all the tutorials, I managed to solve the issue by modifying your script. :D it's now working perfectly fine.👍👍
@Lexmon.
@Lexmon. Жыл бұрын
for some reason the raycast script isnt working properly (using the code from your patreon) Tag: DoorButton is not defined. cs:32
@virtuosogames3664
@virtuosogames3664 3 жыл бұрын
I followed your tutorial exactly and when I left click on the door, the door goes from idle > door close animation when the door is already closed and it never plays the door open animation. I'm not sure what is going on with it.
@SpeedTutor
@SpeedTutor 3 жыл бұрын
You could download my door interaction kit and compare the code?
@rajdhuri2946
@rajdhuri2946 3 жыл бұрын
Thank You so much for this Great Tutorial 🙌🏻
@SpeedTutor
@SpeedTutor 3 жыл бұрын
You're very welcome!
@Dan-ed1sk
@Dan-ed1sk 3 жыл бұрын
got it working, must be careful to follow exactly!
@SpeedTutor
@SpeedTutor 3 жыл бұрын
Yes, absolutely! That's the trials and tribulations of programming, haha. Good work!
@viking805fan
@viking805fan 2 жыл бұрын
Hi there, thanks for the tutorial. Is there a way to make a laser (Line Renderer) trigger the door to open instead of player input by the use of a trigger box collider?
@SpeedTutor
@SpeedTutor 2 жыл бұрын
I'm not sure what you're asking here, isn't this the same thing?
@harvey1839
@harvey1839 3 жыл бұрын
hi man, thank you so much, it works perfectlly, but is it posibble to put a sound when it open and close
@SpeedTutor
@SpeedTutor 3 жыл бұрын
Yes! Just play an audio clip when you play your animation. Just google how to play on audio clip, it will be "PlayOneShot" :)
@harvey1839
@harvey1839 3 жыл бұрын
Wow Amazing, that's great, thank You man, you're very kind
@filipdimitrievskicosmicvis7363
@filipdimitrievskicosmicvis7363 2 жыл бұрын
Yo, this is very cool but i found a moment lacking witch i think is quiet hard to make, but would you like to explain how to make the door not start the close animation all the way from the beginning if clicked on half open door. Thanks
@SpeedTutor
@SpeedTutor 2 жыл бұрын
Oh you would need to create a boolean to check when it is open or closed, then when you click you need to check if it's all the way open or not. I think I cover that in one of more recent videos about opening doors. Maybe the key one? :) You should check that! :)
@D4780896526
@D4780896526 Жыл бұрын
Ive decided to use this method rather than the physics/animated door I was trying to implement and I followed your tutorial twice, once to write the code and test then a second time just to see if I did anything wrong and it all looks exactly the same but nothing is working specifically the raycast. I tried using the debug.drawray and I've tried the comments on this video but unfortunately nothing
@D4780896526
@D4780896526 Жыл бұрын
The raycast does work after some edits but the raycast will not detect the door but will detect other objects
@SpeedTutor
@SpeedTutor Жыл бұрын
Is there a collider and tag on the door? :o
@BlobAlt
@BlobAlt 9 ай бұрын
I know how to make an animated door but the problem is that the door bugs out if i rotate it, because animation isnt additive instead it just sets the door rotation to 0,0,0 and changes it to 0,90,0 . Any help?
@SpeedTutor
@SpeedTutor 9 ай бұрын
If you tick "Root Motion" on the animation component for the door, that could help :)
@xzctrwesfsd
@xzctrwesfsd Жыл бұрын
But what if I have more than 1 door in my project? I need to create new MyDoorController and DoorRaycast scripts with different int-s? Is there not an easier way?
@SpeedTutor
@SpeedTutor Жыл бұрын
No, you can just use the same scripts on each door :)
@xzctrwesfsd
@xzctrwesfsd Жыл бұрын
That didn't work for me but I've found a fix, if anyone else is having this question in 2023 - Instead of having a single raycastedObj variable, change it to an array or a list to store references to multiple doors. e.g. private List raycastedDoors = new List(); and then update the logic in the "Update" function to handle multiple doors according to that change. Don't forget to give your new animated doors/windows/curtains interactable tag and switch Layer to Interact.
@ElectricZoel
@ElectricZoel 4 жыл бұрын
Love your videos!
@SpeedTutor
@SpeedTutor 4 жыл бұрын
Thanks very much! :)
@ElectricZoel
@ElectricZoel 4 жыл бұрын
Your free assets are awesome!
@ElectricZoel
@ElectricZoel 4 жыл бұрын
I'm making a survival fbs game... I used two of your free assets... They work great!
@SpeedTutor
@SpeedTutor 4 жыл бұрын
Which ones did you use? Thanks very much though! :)
@ElectricZoel
@ElectricZoel 4 жыл бұрын
@@SpeedTutor I used the full menu system and the battle royal system.
@swagtrapswag
@swagtrapswag 10 ай бұрын
Followed the entire video yet mine does not work Here are my problems. In the door raycast script. I am missing both the keycode and image properties.. I have looked through your code several times and it is completely identical. Which means I am unable to continue on to the testing phase. As well as an error in the console stating CS1002: ";" expected. Again I have looked through the code and nothing is wrong. Can you help me?? every other door tutorial is too hard and I just cannot look again
@SpeedTutor
@SpeedTutor 10 ай бұрын
Paste the lines of code that are related to the error and I'll see :)
@iamgavinsmith
@iamgavinsmith 4 жыл бұрын
I keep getting NullObjectReference Exception errors. Why is this happening? The door works, but I still get the errors.
@SpeedTutor
@SpeedTutor 4 жыл бұрын
Are you just following along with my tutorial? No other scripts are involved?
@iamgavinsmith
@iamgavinsmith 4 жыл бұрын
@@SpeedTutor Yes
@th3e_m4ng0
@th3e_m4ng0 2 жыл бұрын
This WORKED PERFECTLY! Thank you SOO much!!
@DavidEclipse
@DavidEclipse 2 жыл бұрын
usa un ontriggerEnter
@hurricaneblackandwhite1219
@hurricaneblackandwhite1219 8 ай бұрын
after following all the steps i have gotten stuck on 4 errors about the color, Vector3.foward, Raycast, and forward by itself telling me the namespace isn't found any help would be great
@SpeedTutor
@SpeedTutor 8 ай бұрын
Is the class name the same as the script name. Have you made sure all the capitals are you in the correct places?
@hurricaneblackandwhite1219
@hurricaneblackandwhite1219 7 ай бұрын
@@SpeedTutor i figured it out thank you
@SpeedTutor
@SpeedTutor 7 ай бұрын
What was the solution?
@xEVANcMAN
@xEVANcMAN 3 жыл бұрын
Hi SpeedTutor. I copied exactly as in the vid and some reason my door wont open and the cross hair never changes color. The only difference in our scripts is at one point you used Raycast hit; but thats a compiler error for me so i used RaycastHit hit; dont know if thats why its broke but if anyone can help itd be huge help!
@SpeedTutor
@SpeedTutor 3 жыл бұрын
No you're right, I probably made a mistake in the code during the video and changed it later. Did this tutorial need tags or layers for the door? Any errors?
@xEVANcMAN
@xEVANcMAN 3 жыл бұрын
@@SpeedTutor i tagged the door as interactive object tag that i made spelled the same as code and the layer is interact too. But it dont work. Appreciate any help
@SpeedTutor
@SpeedTutor 3 жыл бұрын
Does your door have a collider on it? Nothing blocking that collider? Did you set the layer in the raycast script in the inspector?
@xEVANcMAN
@xEVANcMAN 3 жыл бұрын
@@SpeedTutor yea man both of those are done. Would it be because iv had to use RaycastHit hit; where you somehow used Raycast hit; that gives me an error as Raycast is not a class for me
@xEVANcMAN
@xEVANcMAN 3 жыл бұрын
Also iv had to use a empty game obj for the pivot but that doesnt need the scripts or animator does it? Think i tried both anyway but maybe youd know
@SilesianKajman
@SilesianKajman Жыл бұрын
i got two errors saying: error cs8805 program using top-level statements must precede namespace and type declarations error cs1022 type or namespace definition or end-of-file expected please help
@SilesianKajman
@SilesianKajman Жыл бұрын
i fixed it but i got more errors :(
@SpeedTutor
@SpeedTutor Жыл бұрын
What errors?
@SilesianKajman
@SilesianKajman Жыл бұрын
@@SpeedTutor nevermind, i fixed it
@wescomvalleninksp
@wescomvalleninksp 7 ай бұрын
the problem with me putting up raycast is when I wrote the code even if I copy pasted it, I NEVER GET IT TO WORK. I either got 100+ errors, or a null reference exception.
@SpeedTutor
@SpeedTutor 7 ай бұрын
I have all the scripts on my Patreon but try and work through your errors because it's a fantastic way to learn, I know it's annoying.
@pyth0n539
@pyth0n539 3 жыл бұрын
I keep getting the error "; Expected" but i have the ";" at the end int mask 1
@bluntfist
@bluntfist 3 жыл бұрын
int mask = 1
@pyth0n539
@pyth0n539 3 жыл бұрын
@@bluntfist Haha, thank you :)
@multicolorcolor
@multicolorcolor 3 жыл бұрын
Thank you. How do I do this for multiple objects I want interaction with? A new raycast/controller script for each object? Or can I specify in raycast script that I want to use multiple controllers?
@SpeedTutor
@SpeedTutor 3 жыл бұрын
You want a different controller that you have on your door, on each and it will work for multiple doors! :)
@raidenthelegendaryclasher5087
@raidenthelegendaryclasher5087 3 жыл бұрын
@@SpeedTutor so we’re supposed to create another controller for the other doors?
@roymgr
@roymgr Жыл бұрын
Hello, I want to thank you for this video and the one about the door with the key, they have helped me A LOT, but I have a question, I'm starting with programming and I don't have much idea what to do, and I wanted to know if you could help me How can I do this but with a button, it's for an Android project haha PS: Sorry if it is not understood but I am using the translator xd
@SpeedTutor
@SpeedTutor Жыл бұрын
I have a tutorial on creating a button, or do you mean a UI button? If so, I have a tutorial on UI buttons too! :)
@dunderguy
@dunderguy 2 жыл бұрын
This works great but what if I want multiple doors without having to create a separate animation for each door? When I duplicate the door it just snaps back to the original's position when I open it instead of playing the animation where the duplicate is. (if that makes any sense)
@SpeedTutor
@SpeedTutor 2 жыл бұрын
Did you set the position of the animation? Make sure to just affect the rotation, would that fix the issue? :)
@BountyIn4K
@BountyIn4K Жыл бұрын
for the [SerializeField] private Image crosshair = null; its mad at me for just putting Image, do you have any idea why? CS0246.
@SpeedTutor
@SpeedTutor Жыл бұрын
Did you add the "UnityEngine.UI" to the top? As one of the namespaces?
@BountyIn4K
@BountyIn4K Жыл бұрын
@@SpeedTutor ahhhhhhhh I didn’t, okie thanks a lot!!
@SpeedTutor
@SpeedTutor Жыл бұрын
You're very welcome! :D
@codyalmgren5903
@codyalmgren5903 2 жыл бұрын
Very good tutorial. I have a question. My crosshair doesn't change color and my door won't open. I've looked over the code but can't find any errors. I then tried to find your door kit on the asset store but couldn't find it. Did you happen to remove it?
@SpeedTutor
@SpeedTutor 2 жыл бұрын
Oh my door pack is on my Patreon now, only those who downloaded my door kit before will still have it on the Unity Store. As to your question, did you tag the door and give it a layer? Do you get any errors?
@codyalmgren5903
@codyalmgren5903 2 жыл бұрын
@@SpeedTutor Tysm for the help. The only error I get is "Animator.GotoState: State could not be found UnityEngine.Animator:Play (string,int,single)"
@SpeedTutor
@SpeedTutor 2 жыл бұрын
Did you upload the name of your animation in the inspector to the one you created? :)
@codyalmgren5903
@codyalmgren5903 2 жыл бұрын
@@SpeedTutor thank you so much I just forgot to do that :)
@SpeedTutor
@SpeedTutor 2 жыл бұрын
Luckily someone had that issue just a little earlier than you! Haha. So I knew the fix! :P Thanks for watching.
@Gaz_Game
@Gaz_Game 8 ай бұрын
Can anyone help me out? When I press "E" at the door it's as if the animation plays but my door isn't actually moving? the crosshair goes white if i look at where the door is not if the animation had actually played.
@SpeedTutor
@SpeedTutor 8 ай бұрын
Is there a collider and tag on the door?
@Gaz_Game
@Gaz_Game 8 ай бұрын
@@SpeedTutor My door object was checked on so I unchecked it and it works fine now! However, I have now noticed that if I spam the button the animation ends with the door rotating out of position?
@3dprint_object
@3dprint_object Жыл бұрын
why is it showing me this error: the type or namespace name 'MyDoorController' could not be found. Please answer quick.
@SpeedTutor
@SpeedTutor Жыл бұрын
Is your script name and class name the same?
@fanvila6533
@fanvila6533 3 жыл бұрын
Thank you and I have a question about the door, there is no error on Unity and visual studio, however, when I get into the game, the door can be opened but after that, it will automatically open and close, is there still have some error in cording??
@SpeedTutor
@SpeedTutor 3 жыл бұрын
I'm not sure what your script looks like? You can download my free door pack on the asset store if you want to check against your code! :)
@tristoncooley9402
@tristoncooley9402 2 жыл бұрын
For the serialize fields its telling that they are valid in this context. I have them typed exactly as you have them.
@SpeedTutor
@SpeedTutor 2 жыл бұрын
Do you have errors elsewhere?
@tristoncooley9402
@tristoncooley9402 2 жыл бұрын
Yeah. The layermasks bits of code towards the bottom are also throwing an error. ExcludeLayerName and fwd.transform, raylength as well. And now upon reloading instead of the serialized field throwing an error its the private right after.
@mustard-223
@mustard-223 2 жыл бұрын
it's okay if this never gets seen, it's not a great place to be asking it got the tutorial working with no issues, although I do have a question. I want to have several types of interactive objects, including chests and dresser drawers as well as doors. I got my chest animations made, but I can't get anything to work for the life of me. I honestly don't know if I should be putting any additional animations in the playAnimation function of the myDoorController script, or if there should be different logic in the doorRaycast that references a separate chest script. in any case, right now I can't get the chest to animate at all, even though I do get a crosshair color change thanks again for the awesome tutorial, regardless if this gets seen or not
@SpeedTutor
@SpeedTutor 2 жыл бұрын
It's hard to know of your implementation for this but if you're just using the raycast to play a script on each object that players an animation. If you make sure the correct animation is being played in each case, shouldn't it work?
@litovizija
@litovizija 2 жыл бұрын
What if for me everything is working fine, but when i put my crosshair on door its not turning red, but its working
@SpeedTutor
@SpeedTutor 2 жыл бұрын
Maybe you're missing the tag? Collider? Anything like that?
@muhammadabdullahkhan5
@muhammadabdullahkhan5 3 жыл бұрын
Hi, Can you help me a little bit how do I set my tag to interactive object and how to set layer to raycast ?? BTW Thanks for tutorial
@SpeedTutor
@SpeedTutor 3 жыл бұрын
Just at the top of the inspector, there are tags and layers. You can click the drop down and choose to add a new tag or layer. Then in the boxes which appear, add a new one in a blank area! :)
@awsumturtle
@awsumturtle 3 жыл бұрын
It worked but i'm having the problem that when you spam click the door it does some weird things. I've tried the fix from below but since my code is a bit different it's not working.
@SpeedTutor
@SpeedTutor 3 жыл бұрын
In my more recent door tutorials and my Door interaction kit, I show you how to sort that issue! :)
@awsumturtle
@awsumturtle 3 жыл бұрын
@@SpeedTutor I figured it out by myself, I dont know if its good code but i decided to add an ienumerator that waits a second before a bool is set to true that controls whether you can open/close the door.
@SpeedTutor
@SpeedTutor 3 жыл бұрын
I think that's what I did, you can check out my free kit on the store and see if it's the same! :)
@Kraizelle
@Kraizelle 3 жыл бұрын
For some reason, i am getting the following error: Tag: InteractiveObject is not defined. UnityEngine.Component:CompareTag(string) I've tried everything but I can't make it work
@SpeedTutor
@SpeedTutor 3 жыл бұрын
Did you create it in your tags?
@chrestycs
@chrestycs 2 жыл бұрын
I got a problem with the raycast, the error says: Assets\MyDoorRaycast.cs(15,30): error CS0246: The type or namespace name 'Image' could not be found (are you missing a using directive or an assembly reference?). Then i added a canvas with a child named Image that is the crosshair, and still doesn't works. I don't know if it's because I didn't got my FPS of your channel of something. Please help me
@chrestycs
@chrestycs 2 жыл бұрын
Would you please give me the script without that or something to fix it?
@SpeedTutor
@SpeedTutor 2 жыл бұрын
Did you add "Using UnityEngine.UI" to to the top?
@chrestycs
@chrestycs 2 жыл бұрын
@@SpeedTutor what's that?
@SpeedTutor
@SpeedTutor 2 жыл бұрын
A namespace to access all the UI scripting references, you'll need :)
@StigDesign
@StigDesign 4 жыл бұрын
Awesome :D i wonder how you could make door like they are in RainBowSix3 rave shield where you could use mouse wheel to slowly open/close door hehe :D what i think might be a way not efficent but, is some how each rotation angel and use inc& dec the rotation angel as long as it is within threshold also local rotation :D
@SpeedTutor
@SpeedTutor 4 жыл бұрын
Exactly! That's why I imagine you'd do it! Depending on your input of the mouse wheel, you'd increase the angle by 10 degrees each time! :)
@StigDesign
@StigDesign 4 жыл бұрын
@@SpeedTutor :D
@benarbiaoussama3152
@benarbiaoussama3152 3 жыл бұрын
Hi i have probleme NullReferenceException: Object reference not set to an instance of an object DoorClosetRayCast.Update () (at Assets/Scripts/DoorClosetRayCast.cs:72)
@SpeedTutor
@SpeedTutor 3 жыл бұрын
What's on line 72?
@vincentjohansson2002
@vincentjohansson2002 3 жыл бұрын
@@SpeedTutor I think he means 42 because I get the samething
@vincentjohansson2002
@vincentjohansson2002 3 жыл бұрын
@@SpeedTutor soory 44 it was
@uduarteextras
@uduarteextras 6 ай бұрын
How do I add sound for opening and closing doors?
@SpeedTutor
@SpeedTutor 6 ай бұрын
I actually have a tutorial on that, you'll find the link in the description :)
@jayarnold9098
@jayarnold9098 2 ай бұрын
Has anyone tried to set their raycast lower than 5? For some reason it doesnt do anything even when set at 1 so it just feels like ive got really long arms
@SpeedTutor
@SpeedTutor 2 ай бұрын
Sometimes the player collider might get in the way of your raycast if you're not careful, sometimes you may have to set your player collider to "Ignore raycast" :)
@littledarkage1-964
@littledarkage1-964 4 жыл бұрын
I instantiate multiple doors in my project, but instead of the door prefab I click, or any door in the scene, only one specific door prefab (the first one to be instantiated) animates. Do you have any idea what might cause this issue? Thanks in advance.
@littledarkage1-964
@littledarkage1-964 4 жыл бұрын
In this part, if I don't put one of the comment lines, it gives null reference error. If I put one of these, it animates the first prefab instantiated like I mentioned previously. Not sure what to do at this point. if (Input.GetKeyDown(openDoorKey)) { //raycastedObj = GameObject.FindWithTag("doorTag").GetComponent(); //raycastedObj = GameObject.Find("doorNew(Clone)").GetComponent(); raycastedObj.PlayAnimation(); }
@SpeedTutor
@SpeedTutor 4 жыл бұрын
I'm not really sure what to suggest to you. :( Could you untie those prefabs?
@littledarkage1-964
@littledarkage1-964 4 жыл бұрын
Not sure what you mean exactly. Thanks for the amazing tutorials by the way.
@SpeedTutor
@SpeedTutor 4 жыл бұрын
As in, unpack the prefab when you start? (And) Thanks very much, I'm glad it was helpful to you! :)
@littledarkage1-964
@littledarkage1-964 4 жыл бұрын
@@SpeedTutor The problem was about my prefab structure. The raycast hit wasn't seeing my prefab's box collider because of some scaling issue in my code, box colliders were occuring somewhere irrelevant. In my previous comment, the code's comment lines caused referencing the first occuring door prefab in the scene for the raycasted object, therefore only that door was being animated no matter which door was clicked. I just wanted to explain for anyone who might have similar issues, and wanted to thank you again, for your tutorials and your willingness to help everyone in the comments.
@aus_bot9899
@aus_bot9899 4 жыл бұрын
i keep getting this error whenever i try to add my RAYCAST into the player Cant Add Script cant add script component 'RAYCAST' because the script class cant be found. Make Shure there are no compile errors and that the file name and class name match. this is my code for RAYCAST using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class NewBehaviourScript : MonoBehaviour { [SerializeField] private int rayLength = 5; [SerializeField] private LayerMask layerMaskInteract; [SerializeField] private string excludeLayerName = null; private MyDoorController raycastedObj; [SerializeField] private KeyCode openDoorKey = KeyCode.Mouse0; [SerializeField] private Image crosshair = null; private bool isCrosshairActive; private bool doOnce; private const string interactableTag = "InteractibleObject"; private void Update() { RaycastHit hit; Vector3 fwd = transform.TransformDirection(Vector3.forward); int mask = 1
@SpeedTutor
@SpeedTutor 4 жыл бұрын
The name of your script is not the same as the class name, look at the top of your script it's called "Class NewBehaviour..." - Give them the same names! :)
@aus_bot9899
@aus_bot9899 4 жыл бұрын
@@SpeedTutor thanks for that
@youkings100
@youkings100 2 жыл бұрын
But what if there are multiple doors in a scene if they all use the same anim controller wouldn't they all open? How would I avoid this?
@SpeedTutor
@SpeedTutor 2 жыл бұрын
No, because they play as different instances :)
@youkings100
@youkings100 2 жыл бұрын
@@SpeedTutor Oh cool good to know, thanks :)
@mxbshr4276
@mxbshr4276 Жыл бұрын
i managed to get this working but the crosshair doesnt go red for some reason?
@SpeedTutor
@SpeedTutor Жыл бұрын
That's very strange, do you have the correct tags?
@mxbshr4276
@mxbshr4276 Жыл бұрын
@@SpeedTutor yeah all the tags are correct on the door, InteractableObject and Interactive
@backture2863
@backture2863 2 жыл бұрын
I have a problem, after opening the door (everything works the) I cannot close the door anymore and the crosshair is also not turning red anymore. Can somebody help?
@SpeedTutor
@SpeedTutor 2 жыл бұрын
Did you remove the tag or anything?
@backture2863
@backture2863 2 жыл бұрын
@@SpeedTutor No I don't think so. I also noticed that when I rotate the door the scale of the door changes, while the real scale doesn't change.
@rutudhwajd
@rutudhwajd Жыл бұрын
please help...please help Getting error 1. name 'fwd' does not exist in current context 2.property of indexer 'Vector3.fwd' cannot be assigned to - it is read onlly
@bencebalogh3807
@bencebalogh3807 Жыл бұрын
Had the same problem, after a lot of googleing, i realised he fixed it at 9:13 :D
@ndnd1915
@ndnd1915 3 жыл бұрын
Is there a way to add multiple different doors into the DoorRaycast script?
@SpeedTutor
@SpeedTutor 3 жыл бұрын
Yes, you'd want an intermediate script which controls what types of doors you can choose from and depending on the tag or type you find, you can do some functionality! :)
@viktorkuska3286
@viktorkuska3286 3 жыл бұрын
@@SpeedTutor Hey! Amazing tutorial, very clear, I'm really interested in being able to open multiple doors, but am not managing, I'm not very familiar with C# and just need this for a personal "project", would you be able to link some code which can be implemented with the code used here?
@infernogamey374
@infernogamey374 2 жыл бұрын
uhmm just checking but the problem now is that i can open and close just fine but when i try getting tru the door I can't the box collider makes me unable the walk tru there and the box collider isn't stuck with the door can anyone help me ?
@SpeedTutor
@SpeedTutor 2 жыл бұрын
You mean you can walk through the door? Is the box collider on the actual door object itself?
@infernogamey374
@infernogamey374 2 жыл бұрын
@@SpeedTutor no and that was the mistake i made it was on the wrong object so it wasn't on the door itself but more on the frame of the door what made it so the door had no collider hahah i'm pretty much a beginner with code and things i do understand things and i start making things myself but thats all thanks to vids like yours really big thx
@SpeedTutor
@SpeedTutor 2 жыл бұрын
Haha, I'm glad it was an easy solution! :P Best of luck on your journey and thanks for coming along to watch my friend! :)
@magplay15
@magplay15 Жыл бұрын
i can't put raycast function in my code, i don't know why
@SpeedTutor
@SpeedTutor Жыл бұрын
What do you mean, exactly? :O
@lisannelin2872
@lisannelin2872 3 жыл бұрын
How do I do this when the door is a child of an empty game object, which I used for changing the pivot point?
@SpeedTutor
@SpeedTutor 3 жыл бұрын
You could make a collider over that empty game object and scale it out? :)
@lisannelin2872
@lisannelin2872 3 жыл бұрын
@@SpeedTutor Thanks, I will try it!
@SpeedTutor
@SpeedTutor 3 жыл бұрын
Good luck! :)
@borka2984
@borka2984 3 жыл бұрын
@@SpeedTutor thank you!! It worked
@George-wc3hg
@George-wc3hg 3 жыл бұрын
Hey might be a very dumb error, But my door is animating constantly. And im not exactly sure why.
@SpeedTutor
@SpeedTutor 3 жыл бұрын
You don't have this in update, do you?
@George-wc3hg
@George-wc3hg 3 жыл бұрын
@@SpeedTutor I Copied everything exactly as shown. Every function is good.
@cgnotavailable
@cgnotavailable 2 жыл бұрын
Can somebody give me the code because i did something wrong and i dont know how to repair
@SpeedTutor
@SpeedTutor 2 жыл бұрын
What error do you get? :)
@Tatsukibaba
@Tatsukibaba 2 жыл бұрын
@@SpeedTutor me give me the scripts please
@Wabbaxt
@Wabbaxt 3 жыл бұрын
How could you and functioning ui to it ?
@SpeedTutor
@SpeedTutor 3 жыл бұрын
I'm not sure what you mean?
@Wabbaxt
@Wabbaxt 3 жыл бұрын
i mean like when you look at the door it says (press E to open) and when open and you look at it again it says (press E to close)
@EltonOliveiradrknss
@EltonOliveiradrknss 3 жыл бұрын
What does the pipe ( | ) do? I didnt understand and also didnt find any answers
@SpeedTutor
@SpeedTutor 3 жыл бұрын
Two of those together, usually mean (OR) So lets say: if(myInt == 1 || myInt == 7) { //Do something } It just means that if the number is equal to 1 (OR) 7 - The statement can be true! :)
@EltonOliveiradrknss
@EltonOliveiradrknss 3 жыл бұрын
@@SpeedTutor Thanks a lot for answering
@RyanJhider
@RyanJhider 3 жыл бұрын
Hi my friend the door Collid with my character and make it fly how can a do to reduce this effect ?
@minedog4141
@minedog4141 3 жыл бұрын
If you have rigidbody on it take it off
@RyanJhider
@RyanJhider 3 жыл бұрын
@@minedog4141 I don't have any rigidbody :/ only a character controller
@minedog4141
@minedog4141 3 жыл бұрын
@@RyanJhider i meant the door
@RyanJhider
@RyanJhider 3 жыл бұрын
@@minedog4141 The door too :/
@minedog4141
@minedog4141 3 жыл бұрын
@@RyanJhider well take the character controller outta there
@gamergarand9894
@gamergarand9894 2 жыл бұрын
Bro it's saying namespace 'Image' could not be found
@SpeedTutor
@SpeedTutor 2 жыл бұрын
Did you add the namespace to the top: "using UnityEngine.UI;"?
@gamergarand9894
@gamergarand9894 2 жыл бұрын
@@SpeedTutor No
@gamergarand9894
@gamergarand9894 2 жыл бұрын
I will add if it works thanks
@SpeedTutor
@SpeedTutor 2 жыл бұрын
Fantastic! :D
@mikk86
@mikk86 4 жыл бұрын
Hei SpeedTutor, its me again :) Thank you for your last answer again. Do you have any quick idea of how to prevent the multi clicking on the door and prevent restarting the function? Thanks :)
@SpeedTutor
@SpeedTutor 4 жыл бұрын
You could create a little cooldown timer, using a co-routine each time you click it. Set a boolean true when it's clicked, set it to false in the cooldown and check that boolean in the code when you click or play the animation! :)
@mikk86
@mikk86 4 жыл бұрын
@@SpeedTutor Thank you very much again:)
@Tatsukibaba
@Tatsukibaba 2 жыл бұрын
it says keycode cannot be found, are you missing a assembly reference?
@SpeedTutor
@SpeedTutor 2 жыл бұрын
What does your line look like?
@Tatsukibaba
@Tatsukibaba 2 жыл бұрын
@@SpeedTutor it says the type or namespace keycode cannot be found, are you missing a assembly reference? Can you help
@Tatsukibaba
@Tatsukibaba 2 жыл бұрын
@@SpeedTutor hi
@SpeedTutor
@SpeedTutor 2 жыл бұрын
Hello, show me the line you've written.
@Tatsukibaba
@Tatsukibaba 2 жыл бұрын
@@SpeedTutor how?
@blacklakemedia7838
@blacklakemedia7838 3 жыл бұрын
NullReferenceException: Object reference not set to an instance of an object DoorRaycast.CrosshairChange (System.Boolean on) (at Assets/DoorRaycast.cs:63) DoorRaycast.Update () (at Assets/DoorRaycast.cs:36) Can anyone Help me understand what i did wrong ?
@SpeedTutor
@SpeedTutor 3 жыл бұрын
What are on those two lines?
@blacklakemedia7838
@blacklakemedia7838 3 жыл бұрын
@@SpeedTutor 36 CrosshairChange(true); 64 crosshair.color = Color.red;
@SpeedTutor
@SpeedTutor 3 жыл бұрын
Did you add the crosshair UI to the inspector?
@blacklakemedia7838
@blacklakemedia7838 3 жыл бұрын
@@SpeedTutor thank you. thats was it
@zprey8385
@zprey8385 2 жыл бұрын
how to choose a range to player can interact in that range ?
@SpeedTutor
@SpeedTutor 2 жыл бұрын
The ray distance? Or Ray length? In the raycast script, I can't recall what I used. :)
@MCShvabo
@MCShvabo 2 жыл бұрын
Would this work on a 3rd person?
@SpeedTutor
@SpeedTutor 2 жыл бұрын
It could do, yes! :)
@MCShvabo
@MCShvabo 2 жыл бұрын
@@SpeedTutor I'll try it tomorrow, thanks so much!
@MCShvabo
@MCShvabo 2 жыл бұрын
@@SpeedTutor I finally got around doing it and you were right, thanks so much! Just a note for anyone who tries to do this with a 3rd person character in the future, the only difference is that you might have to make your ray length a bit higher, since it's the camera, not the player character that interacts with the object, and camera is obviously further away if you are using a 3rd person view. I had to set ray length to 9 in order to make it work but it really depends on your setup.
@rafaaaaa478
@rafaaaaa478 3 жыл бұрын
I did the tutorial, but id didn't work, the crosshair changes to red, but the door don't open.
@SpeedTutor
@SpeedTutor 3 жыл бұрын
Any errors?
@darkdoom907
@darkdoom907 2 жыл бұрын
02:47 open and close animation from same base
@SpeedTutor
@SpeedTutor 2 жыл бұрын
Are you asking a question? :o
@darkdoom907
@darkdoom907 2 жыл бұрын
@@SpeedTutor Nope
OPENING a DOOR using a BUTTON
18:38
SpeedTutor
Рет қаралды 25 М.
OPENING a DOOR with a KEY! (Unity Beginner Tutorial)
20:25
SpeedTutor
Рет қаралды 40 М.
When you have a very capricious child 😂😘👍
00:16
Like Asiya
Рет қаралды 11 МЛН
It’s all not real
00:15
V.A. show / Магика
Рет қаралды 20 МЛН
Правильный подход к детям
00:18
Beatrise
Рет қаралды 10 МЛН
Unity 3D: Animate & Trigger A Door
21:30
Kyle Broad
Рет қаралды 44 М.
OPENING a DOOR in UNITY on TRIGGER EVENT
8:20
SpeedTutor
Рет қаралды 119 М.
AI Learns to Play Dodgeball
10:59
AI Warehouse
Рет қаралды 1 МЛН
How I Made a 3D Platformer in 2D Game Engine
21:23
ggenije
Рет қаралды 569 М.
Making a difficult game about fitting in - Acerola Jam 0
19:17
jess::codes
Рет қаралды 459 М.
How To Make A Game Alone
8:11
Thomas Brush
Рет қаралды 1,2 МЛН
No, I Made The Hardest Game Ever
7:51
Zanthous Game Development
Рет қаралды 23 М.
Making Minecraft from scratch in 48 hours (NO GAME ENGINE)
16:38
When you have a very capricious child 😂😘👍
00:16
Like Asiya
Рет қаралды 11 МЛН