4567777
|
  |
| Joined: 13 Jul 2013 |
| Total Posts: 128 |
|
|
| 17 Nov 2013 10:48 PM |
I am ray-casting from the players torso downwards, so I can detect whether the player is touching the ground and what material he is touching.
the problem is that if I move far enough from the middle of the baseplate, the ray doesn't detect anything even though I'm still on top of the baseplate.
here is my script:
local ray = Ray.new(torso.CFrame.p,torso.CFrame.p - Vector3.new(0,8,0)) local ignore = {game.Workspace.part1, game.Workspace.part2} local hit, position = Workspace:FindPartOnRayWithIgnoreList(ray, ignore) if(hit~=nil)then print('touching ground on: '..hit.Name) touchingGround = true local surface = hit:FindFirstChild('surfaceType',true) if(surface~=nil)then print(hit.surfaceType.Value) surfaceType = hit.surfaceType.Value end end if(hit==nil)then print('not touching ground') touchingGround = false end
yes I defined surfaceType,touchingGround and torso |
|
|
| Report Abuse |
|
4567777
|
  |
| Joined: 13 Jul 2013 |
| Total Posts: 128 |
|
| |
Oysi
|
  |
| Joined: 06 Jul 2009 |
| Total Posts: 9058 |
|
| |
|
| 17 Nov 2013 11:49 PM |
Umg its oysi! :O
♫♪ repeat wait() until game.Players.FrozenSmite.HasALife == true ♪♫ |
|
|
| Report Abuse |
|
4567777
|
  |
| Joined: 13 Jul 2013 |
| Total Posts: 128 |
|
|
| 18 Nov 2013 12:35 AM |
| thank you so much, it works now! :) |
|
|
| Report Abuse |
|