Watch this video in context on Unity's learning pages here - unity3d.com/lea... How to use Rays to detect line of sight and angular calculations. Help us caption & translate this video! amara.org/v/V6cF/
I have to say, these tutorials are superb. very easy to listen to and follow, explains not only to code for ray casting but also the basic concepts. Excellent.
Being new to unity I have an idea for a game, The story is now based around an evil box that betrayed the main character and killed his father. Good tutorials by the way, very helpful.
You helped me so much, thank you :D I was looking for a reliable method for collision detection (for example when the character falls or jumps) and your video was perfect for my purpose
Question: Is there a way for an object to detect that is being hit by the raycast? I'll give an example. Let's say we have a player and a box. The player has the raycast script, while the box detects when it is being hit by the raycast. So the player looks at the box and in the box script, it detects it and does something
On best practices (unity3d.com/learn/tutorials/topics/physics/physics-best-practices) use of Raycasting inside update is discouraged (and inside fixed update too), better to use when needed or inside a coroutine to limit call frequency using an infinite loop.
Those tutorials are great. I think that in the script, a "deployed = false" may be added in the void OnCollisionEnter so you can use the parachute again with this evil box. Am I right or did I miss something ?
Can anyone tell me how I can make a physical laser shoot from a controller (oculus left controller) when I press the left trigger button? I need it to interact with a UI canvas and press the buttons. I tried something like this, but nothing has worked so far.
set your wall tagged "wall" then write if(hit.collider.tag == "wall") { //do what ever } you can rename the wall to whatever you want. next time use Unity3d Answers =)
The thing that sucks about my brain is its really hard to interpret things correctly, so I was pretty much lost through a majority of this video... really sucks, looks like a nice tutorial.
its information about the thing that the raycast is hitting. It's needed to tell the raycast that it's actually hitting something. You can also make it,like he said,work only with specific layers,so this RayCastHit checks if that's the layer.
"Betrayed him and killed his father" LOL ho god I didn't expect that at all.
Instantly made me think of Shenmue.
@@themusicguy1989 You weird bro, DId you just replied to a 7-year-old comment lol
I was going to say that.
Right
The evil box that betrayed him and killed his father LOL! Love it!
The humor in these tutorials are worthy of a Netflix special.
Box!!! WHY HAVE YOU BETRAYED ME!?!?
+Omar Moodie living the box life
He called me a square, that really twisted my corners.
i am your father
It called Cube in the editor
I have to say, these tutorials are superb.
very easy to listen to and follow, explains not only to code for ray casting but also the basic concepts.
Excellent.
I just like how you do it; saying jokes in the voice of a tutorial guy. I just love it.
the real question is, why did the evil box kill the players father
Thought this was going to be confusing, turned out to be pretty straightforward, really nice tutorial!
Evil box, why you do this?
Most Comments: Why Evil Box, Me: Why wont my code work?
basicly me rn (sorry for that english)
its too old they changed the language a bit
I'd like to break the thumbs up button for this style of tutorial; please more in the
Even Unity tutorials have lore
Make more god damn videos like this cuz this was nicely explaned.
lol this is a 2015 comment, im here in 2020 using 5.6.3
that capsule and box is more interesting than my whole life
This is a great tutorial, short, sweet and informative
Being new to unity I have an idea for a game, The story is now based around an evil box that betrayed the main character and killed his father.
Good tutorials by the way, very helpful.
You helped me so much, thank you :D
I was looking for a reliable method for collision detection (for example when the character falls or jumps) and your video was perfect for my purpose
i'm curious, is this tutorial still up to date?
yes
sept 2020, still is
@@000zeRoeXisTenZ000 now?
@@ZeonplayzYt Pretty much, yeah, if you are still wondering
I learn a LOT thanks Unity Tutorials!
Man,you are good at explaining unity stuff keep it up
I know right its 1:18 am in the morning i'm supposed to be sleeping but i'm watching this because its fun and informative XD
Yo unity is good at explaining unity stuff
Thank you for this great information
awesome tutorial
that betrayed him and killed his father that's too cold for a tutorial
🤣
You made my day with this joke about evil betrayer box XD
Oldie but goodie! This is still a really cool raycasting tutorial 👍🤓
Thanks! Glad you still find it helpful!
bro the intro 💀💀💀
😂
please explain the use of layer mask a bit clearer
Quick Question:
Is there a way to change a string to the tag of an object without using layering because im using that for other things?
AMAZING TUTORIAL, great work unity!!!!!!!!!!!!!!
Question:
Is there a way for an object to detect that is being hit by the raycast?
I'll give an example. Let's say we have a player and a box.
The player has the raycast script, while the box detects when it is being hit by the raycast. So the player looks at the box and in the box script, it detects it and does something
this is so useful ! THX!
On best practices (unity3d.com/learn/tutorials/topics/physics/physics-best-practices) use of Raycasting inside update is discouraged (and inside fixed update too), better to use when needed or inside a coroutine to limit call frequency using an infinite loop.
I see
thank youuu
0:45 how do you determine these coordinates ( vector3 direction) if you want it to be facing an object like for example a camera that moves around?
Right hand rule: the x and y should be flipped in the ray direction drawing
ray cast can be used as a cool enemy spot or a camera sight
So this isn't to play Dreamcast games on Android?
***** xD
No wander deleting the default cube always feels good for some reason. Blender🤝🌚
that box is really evil xD
So i want to destory an "special" object when i click a button and my raycast is pointed at it
Any ideas?
if(physics.raycast(...))
{
Destroy(hit.gameobject);
}
such a simple looking 5 seconds thing.. a box about to land using parachute.... yet 100 things you have to fix manually happen in the background :/
What does "out hit" in line 19 mean? I'm not familiar with that type of syntax.
It assigns the object hit/collided by the ray to the variable hit.
I need to know what if there is multiple possible landing positions in the ray wich one is counted to start the parachute
UGH, Why are raycasts so hard!
LittleBigPancake Nooo,it's not so hard,I swear
Those tutorials are great.
I think that in the script, a "deployed = false" may be added in the void OnCollisionEnter so you can use the parachute again with this evil box.
Am I right or did I miss something ?
This was really helpful.
when does the OnCollisionEnter work??
It is not called anywhere...
Awesome tutorial. Thanks!!!!
Thank you, it was really helpful !!!
I couldn't find a way to make it work with 2D colliders, changing things like ray to ray2D or raycast to raycast2D didn't work for me.
Would love to have an example project of this.
Can anyone tell me how I can make a physical laser shoot from a controller (oculus left controller) when I press the left trigger button? I need it to interact with a UI canvas and press the buttons. I tried something like this, but nothing has worked so far.
why is it rays in my game takes 30 seconds to a minute to start bloody working.
guys any sample using raycast on fast moving objects? cant seem to detect collisions. thanks :)
Is there a chance to get the robot lab for unity 3.5?
Best story ever! :D
So is the sphere's father a circle???
haha best tutorial ever. WHY U DO THIS BOX!?
You mean in the OnCollisionExit?
Raycast is not detecting terrain... Help...
How can I check if the Raycast hits an Object tagged as "Wall" for example?
set your wall tagged "wall" then write
if(hit.collider.tag == "wall")
{
//do what ever
}
you can rename the wall to whatever you want.
next time use Unity3d Answers =)
Thanks :)
I have one question what does the out keyword do?
how can i use raycasting like wolvenstien 3d did
Now I know what a Vector 3 is.
Thanks! For You Help Now The Tree Will Pay For Not Giving My Player Wood!
The thing that sucks about my brain is its really hard to interpret things correctly, so I was pretty much lost through a majority of this video... really sucks, looks like a nice tutorial.
plot twist: the box is the mother and the capsule is an actor from star wars but took a wrong left turn
The out keyword causes the variable to be passed by reference
Could you please explain what does that mean?
Blenders cube came to unity oh no
New cool 😎 friends here 👍🏻 interesting 🤨 video
LOL, "Betrayed him and killed his father"
Nice tutorial.👍
3:18
animation should play before the drag effect comes
So this tutorial is outdated?
thank you
Plot twist the box is actually his father!
Can I use it in 2d games ?
+AbdelGhafour Mohie El-Deen yeah just use Physics.Raycast2D and instead of vector 3s, you will have vector 2s
thanks man ...really saved my arse today XD
Thank you great vid :)
Character: Hello. My name is Inigo Montoya. You killed my father. Prepare to die.
Why is this not working for me :(
pretty sure this is outdated, i could be wrong but google unity RaycastHit
pretty unsure if its outdated now xD anyways good luck
I'mma Raycast the whole world 😟
Nice
void write()
{
Console.WriteLine("PUT THE BRACE IN THE UPPER LINE");
}
That got dark fast lol
Who is here because of Jonas?
Is this voiced by +3kliksphilip ? Really sounds like him!
+Mornedil Not really though.
! Uh oh. The ray have started to move!
quick press the b button! oh wait wrong game XD
is that.... *eyes begin to glow* COMIC SANS ?
자막이 엉망
helpful :)
what is raycasthit
its information about the thing that the raycast is hitting. It's needed to tell the raycast that it's actually hitting something. You can also make it,like he said,work only with specific layers,so this RayCastHit checks if that's the layer.
EVIL BOX!!!!
ahaha an evil box that betrayed and kill his father nice story bro :D
ur brutal but i learn something
how to use google VR with Raycast
this is a lot like roblox studio lol
roblox is cringe
serious, poor English Guys really need Transform
RIP headphone users
Ok, when the parachute is completely open it slow down the speed landing of crate this thing happen by ? simulation, animation or scripting?