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
 

Re: RAY CASTING

Previous Thread :: Next Thread 
mrmcmuffinz123 is online. mrmcmuffinz123
Joined: 04 Aug 2014
Total Posts: 810
13 Jul 2017 08:25 PM
I'm trying to learn more about ray casting but I need a little help. I'm trying to find the distance below and object but how would i accomplish that?


Report Abuse
vastqud is not online. vastqud
Joined: 10 Sep 2011
Total Posts: 2464
13 Jul 2017 09:11 PM
local ################ # ###################### (part.CFrame.p - Vector3.new(0,500,0)).unit*500) local hit, position = workspace:FindPartsOnRay(ray, part, false, true) local distance = part.CFrame.p - position something like that
Report Abuse
vastqud is not online. vastqud
Joined: 10 Sep 2011
Total Posts: 2464
13 Jul 2017 09:13 PM
pastebin /PzQwF9GJ


Report Abuse
vastqud is not online. vastqud
Joined: 10 Sep 2011
Total Posts: 2464
13 Jul 2017 09:14 PM
sorry add a .magnitude at the end of the last line


Report Abuse
vastqud is not online. vastqud
Joined: 10 Sep 2011
Total Posts: 2464
13 Jul 2017 09:14 PM
lol sorry for spamming your thread but here is what the last line is supposed to be

local distance = (part.CFrame.p - position).magnitude


Report Abuse
mrmcmuffinz123 is online. mrmcmuffinz123
Joined: 04 Aug 2014
Total Posts: 810
13 Jul 2017 09:58 PM
Alright thanks!


Report Abuse
mrmcmuffinz123 is online. mrmcmuffinz123
Joined: 04 Aug 2014
Total Posts: 810
14 Jul 2017 02:08 PM
I tried printing distance to see the distance between the block below the object but all it does is print fi ve ze ro ze ro


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