fun4nerd
|
  |
| Joined: 30 Oct 2013 |
| Total Posts: 4440 |
|
|
| 02 Mar 2015 07:23 AM |
| How do I make the raycast go into different directions instead of having it go forward! |
|
|
| Report Abuse |
|
duckwit
|
  |
| Joined: 08 Aug 2008 |
| Total Posts: 1310 |
|
|
| 02 Mar 2015 07:42 AM |
The direction and length of the ray is specified by a Vector3 as the second parameter to the Ray.new() constructing function.
A vector is a mathematical entity that describes a magnitude (length) and direction in n-dimensional space. In this case, the world has 3 dimensions: x (left/right), y (up/down), z (forwards/backwards).
For example, the vector (1,0,0) points in the positive x-direction (right) and (-1,0,0) points in the negative x-direction (left).
By specifying a vector for the direction, you can set the direction of a ray:
someRay = Ray.new(startingPosition, direction)
The magnitude of the vector 'direction' will determine the length of the ray. |
|
|
| Report Abuse |
|
fun4nerd
|
  |
| Joined: 30 Oct 2013 |
| Total Posts: 4440 |
|
|
| 02 Mar 2015 07:44 AM |
| wow duck! let me see what i can do |
|
|
| Report Abuse |
|