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
We use cookies to offer you a better experience. By using Roblox.com, you are agreeing to our Privacy and Cookie Policy.
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Too long of a ray being made?

Previous Thread :: Next Thread 
88GB is not online. 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 is not online. 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 is not online. 88GB
Joined: 03 Oct 2011
Total Posts: 1465
21 Mar 2015 01:37 PM
:3

Thanks.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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