|
| 18 May 2013 05:12 PM |
Could some explain what ray.Unit returns? This is what I get:
local ray = Ray.new(game.Workspace.Part1.Position, game.Workspace.Part2.Position) print (ray.Unit)
>{-19, -0.200000048, -21}, {-0.253571182, 0.177499816, -0.950891912} |
|
|
| Report Abuse |
|
|
MrNicNac
|
  |
| Joined: 29 Aug 2008 |
| Total Posts: 26567 |
|
|
| 18 May 2013 05:23 PM |
It returns exactly what you have it, except for the direction (the second argument) is normalized to a unit vector - meaning all of it's values are out of 1. They can be from -1 to 1.
Unit meaning like a unit cube. For directions, all you need is -1 through 1. Where 1 is being directly along an axis, and -1 being directly opposite of that axis. |
|
|
| Report Abuse |
|
|
dekkonot
|
  |
| Joined: 22 Dec 2010 |
| Total Posts: 6685 |
|
|
| 18 May 2013 05:24 PM |
It returns a ray with a normalized direction.
~ Linguam latinam est optimum ~ |
|
|
| Report Abuse |
|
|