|
| 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
|
  |
| 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 |
|