|
| 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
|
  |
| 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
|
  |
| Joined: 10 Sep 2011 |
| Total Posts: 2464 |
|
| |
|
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
|
  |
| 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 |
|
|
| |
|
|
| 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 |
|
|