88GB
|
  |
| Joined: 03 Oct 2011 |
| Total Posts: 1465 |
|
|
| 21 Mar 2015 01:32 PM |
wait(2) local user = game.Players.LocalPlayer.Character
game.Players.LocalPlayer:GetMouse().Button1Down:connect(function() local ray = Ray.new(game.Players.LocalPlayer.Character.Torso.Position,game.Players.LocalPlayer:GetMouse().hit.p.unit*300) local partHit,EndPosition = game.Workspace:FindPartOnRay(ray) if partHit ~=nil then if partHit.Name == "COMEHERELADS" then print'Raycasting test is completed :)' end end end)
It only prints at a very small distance from the brick, how can I make it work from longer distances? |
|
|
| Report Abuse |
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 21 Mar 2015 01:35 PM |
'game.Players.LocalPlayer:GetMouse().hit.p.unit*300)' That part is wrong, you wanna either use the lookVector or subtract that from the torso's position and then use unit |
|
|
| Report Abuse |
|
88GB
|
  |
| Joined: 03 Oct 2011 |
| Total Posts: 1465 |
|
| |