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
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Why isn't this ray working?

Previous Thread :: Next Thread 
CeaselessSoul is not online. CeaselessSoul
Joined: 03 Jul 2012
Total Posts: 7506
22 Nov 2012 07:00 PM
start = Vector3.new(0,0,0)
lootAt = Vector3.new(0,0,10)
ray = Ray.new(start, (lookAt-start).unit)
hit = game.Workspace:FindPartOnRay(ray,nil)
if hit then print("Part")
else print("Nil")
end

It's simple, but I get this output:

19:58:58.835 - Workspace.Script:3: bad argument #1 to '?' (Vector3 expected, got nil)
19:58:58.842 - Script "Workspace.Script", Line 3
19:58:58.842 - stack end

There's nothing nil... I just copied the example(somewhat) on the Wiki.

Want a script? Send me a PM and we'll work out a deal!
Report Abuse
CeaselessSoul is not online. CeaselessSoul
Joined: 03 Jul 2012
Total Posts: 7506
22 Nov 2012 07:01 PM
Never mind... Spelling error.

Want a script? Send me a PM and we'll work out a deal!
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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