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: Someone explain ray casting to me..

Previous Thread :: Next Thread 
oplmn1 is not online. oplmn1
Joined: 25 Nov 2010
Total Posts: 994
24 Feb 2014 05:29 PM
I was on the wiki, copied this, read the arcital, and I don't get it..
Explain this to me please.


local ray = Ray.new(tool.Handle.CFrame.p, (mouse.Hit.p - tool.Handle.CFrame.p).unit*300)
local hit, position = game.Workspace:FindPartOnRay(ray, user)
local humanoid = hit and hit.Parent and hit.Parent:FindFirstChild("Humanoid")
Report Abuse
oplmn1 is not online. oplmn1
Joined: 25 Nov 2010
Total Posts: 994
24 Feb 2014 05:33 PM
Please?
Report Abuse
200AB is not online. 200AB
Joined: 24 Aug 2010
Total Posts: 1604
24 Feb 2014 05:34 PM
Did you seriously just bump a thread that was not even half way down the first page?
Report Abuse
oplmn1 is not online. oplmn1
Joined: 25 Nov 2010
Total Posts: 994
24 Feb 2014 05:35 PM
Yes, Yes I did.
Report Abuse
jewelycat is not online. jewelycat
Joined: 10 Sep 2008
Total Posts: 17345
24 Feb 2014 05:36 PM
Have u tried


going to SH?
Report Abuse
oplmn1 is not online. oplmn1
Joined: 25 Nov 2010
Total Posts: 994
24 Feb 2014 05:36 PM
Yes, Yes I have.
Report Abuse
jewelycat is not online. jewelycat
Joined: 10 Sep 2008
Total Posts: 17345
24 Feb 2014 05:38 PM
Have u tried


staying in SH?
Report Abuse
oplmn1 is not online. oplmn1
Joined: 25 Nov 2010
Total Posts: 994
24 Feb 2014 08:48 PM
No, No I haven't
Report Abuse
oseday is not online. oseday
Joined: 27 Aug 2008
Total Posts: 1308
25 Feb 2014 05:50 AM
You send a ray from start to the point it should look for how many studs you want it to go. And then you can check for the first part that the ray hit. Pretty easy.
Report Abuse
StealthKing95 is online. StealthKing95
Joined: 13 Dec 2008
Total Posts: 4263
25 Feb 2014 10:22 AM
local startVector3 = tool.Handle.CFrame.p
local directionVector3 = (mouse.Hit.p - tool.Handle.CFrame.p).unit
local distance = 300
local partsForRayToIgnore = {workspace.Part, workspace.BasePlate}


local ray = Ray.new(startVector3, directionVector3 * distance)

local hit, position = game.Workspace:FindPartOnRay(ray, partsForRayToIgnore)

Report Abuse
oplmn1 is not online. oplmn1
Joined: 25 Nov 2010
Total Posts: 994
25 Feb 2014 03:46 PM
Thanks stealth.
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