generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Ray.Unit

Previous Thread :: Next Thread 
Justin55555555555 is not online. Justin55555555555
Joined: 01 Oct 2008
Total Posts: 302
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 is not online. 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 is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image