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
 

Can someone give me an example of findpartonray()

Previous Thread :: Next Thread 
SpecterSlash is not online. SpecterSlash
Joined: 29 Aug 2009
Total Posts: 629
03 Jun 2014 01:53 AM
I need someone to give me an example for it please

for example there are 3 bricks, brick 1, brick 2 and brick 3

brick 2 is between brick 1 and 3,
how can i use findpartonray() to detect it?

bonus question: what happens if it doesnt detect anything?
Report Abuse
wazap is not online. wazap
Joined: 29 Jun 2007
Total Posts: 23234
03 Jun 2014 02:56 AM
local ray = Ray.new(brick1.Position, (brick3.Position-brick1.Position))

local partInBtwn=workspace:FindPartOnRay(ray, brick1)
if partInBtwn then print(partInBtwn.Name) end

Bonus answer: if nothing in btwn then partInBtwn will be nil
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