Raycast: Difference between revisions

link to Object
(Small improvements)
(link to Object)
Tags: Mobile edit Mobile web edit Advanced mobile edit
 
(2 intermediate revisions by the same user not shown)
Line 12: Line 12:
Traces a line between two points and outputs the following correspondingly:
Traces a line between two points and outputs the following correspondingly:


* [[Truth (True & False)|True]] if it hits an object.
* [[Truth (True & False)|True]] if it hits an [[object]].
* The point where the object is detected, or <code>0, 0, 0</code> otherwise.
* The point where the object is detected, or <code>0, 0, 0</code> otherwise.
* The object that was hit, or <code>None</code> if none is detected or the ground is hit.
* The object that was hit, or <code>None</code> if none is detected or the ground is hit.
Line 33: Line 33:
On the first frame the normal block can then be moved to the floor, and set to visible (being inside a script block makes it start not visible).
On the first frame the normal block can then be moved to the floor, and set to visible (being inside a script block makes it start not visible).
Then set it in the path of a Raycast line to turn it red.
Then set it in the path of a Raycast line to turn it red.
== Examples ==
Cast a ray in the direction an object is facing.
The <code>{{Port|v|0,0,1}}</code> indicates the object points in the positive Z axis by default, and the raycast length is 1.
{{Image|Raycast example1.png}}


[[Category:Blocks]]
[[Category:Blocks]]