- Home /
project a ray in a straight line
I am working on raycasts for the first time, and have looked at the various kinds of ways a raycast can be done in the manual. I imagine raycasts are hard to understand for people new to it, because I cannot tell which of the rays casts a single line in a one direction.
this is the manuals page I'm looking at, http://docs.unity3d.com/ScriptReference/Physics.Raycast.html
what I'm asking is which script shown casts a single line in a single direction.
Answer by NoseKills · Jul 10, 2014 at 08:29 PM
All of them :)
A Ray in Unity is basically always a 3-dimensional vector that has a starting point and length (length can be infinite)
When they say:
Casts a ray against all colliders in the scene.
It just means that the ray will produce a hit (return value "true") from all colliders in the scene that it hits (as opposed to some of the calls that filter out colliders based on their layers for example)
Your answer
Follow this Question
Related Questions
Raycast returns null for no apparent reason 0 Answers
Problem with raycast distance 1 Answer
how to select an object with raycasting 1 Answer
[SOLVED] Raycast for custom button JS 1 Answer
What's wrong with my RaycastHit2D? 1 Answer