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 » Scripters
Home Search
 

Rays and Orientation.

Previous Thread :: Next Thread 
gaberocksall is not online. gaberocksall
Joined: 23 Apr 2016
Total Posts: 207
27 Jul 2017 11:32 PM
The way to make a ray, is by using "Ray.new(Vector3(Origin),Vector3(Direction))". Is there any way at all to calculate the Ray's direction by using orientation?

For example setting a ray with its Origin being a part in workspace, and its direction being the front facing Surface of the part? Thanks!
Report Abuse
TruSight is not online. TruSight
Joined: 08 Nov 2010
Total Posts: 983
28 Jul 2017 12:06 AM
local partInWorkspace = workspace.Part local ################ # ################################# partInWorkspace.CFrame.lookVector * 500) This'll cast a ray starting from the "front surface" of the part.
Report Abuse
TruSight is not online. TruSight
Joined: 08 Nov 2010
Total Posts: 983
28 Jul 2017 12:07 AM
Ray.new(workspace.Part.CFrame.p, workspace.Part.CFrame.lookVector * 500)

Use lookVector to start at the "front surface" of the part.


Report Abuse
gaberocksall is not online. gaberocksall
Joined: 23 Apr 2016
Total Posts: 207
28 Jul 2017 12:12 AM
Thank you so much! Do you know how i could do the same thing, but with the Top surface? This is unnecessary, but would be helpful because this way the orientation will not be skewed by 90?
Report Abuse
Smeers is online. Smeers
Joined: 14 Feb 2013
Total Posts: 797
28 Jul 2017 12:15 AM
Use upVector instead of lookVector. Down would be negative upVector.

Valid vector values for CFrames are up, look, and right.
Report Abuse
TruSight is not online. TruSight
Joined: 08 Nov 2010
Total Posts: 983
28 Jul 2017 12:15 AM
Instead of lookVector, use upVector (never tested that myself, but it does exist so should work)


Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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