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 » Scripters
Home Search
 

Re: Ray

Previous Thread :: Next Thread 
DiamondBladee is not online. DiamondBladee
Joined: 24 Feb 2013
Total Posts: 3527
10 Apr 2016 05:30 PM
local RawRay = Camera:ScreenPointToRay(input.Position.X, input.Position.Y, 0)
local ExtendedRay = Ray.new(RawRay.Origin, RawRay.Direction*500)
local Target = workspace:FindPartOnRay(ExtendedRay)


This works just fine. But do I really have to create a second ray? Can I somehow multiply the first?
Report Abuse
RoflBread is not online. RoflBread
Joined: 18 Jun 2009
Total Posts: 3803
10 Apr 2016 05:34 PM
What does the third argument for the camera method you used do? If it's not the length of the ray then yeah you'd have to create another ray. There's no way to extend one that's already initialised.
Report Abuse
DiamondBladee is not online. DiamondBladee
Joined: 24 Feb 2013
Total Posts: 3527
10 Apr 2016 05:57 PM
Third argument is this according to the wiki:

depth
Type: float
Defaults to: 0


I can't figure out what it actually does though.
Report Abuse
RightLegRed is not online. RightLegRed
Joined: 02 Oct 2009
Total Posts: 6761
10 Apr 2016 06:08 PM
0 is how far the ray will go in terms of depth in the camera, so things which are further away.
Report Abuse
DiamondBladee is not online. DiamondBladee
Joined: 24 Feb 2013
Total Posts: 3527
10 Apr 2016 06:09 PM
@Right And given that objects can be either on the ground or in the sky in my game, I'll have to create that second ray...
Report Abuse
RightLegRed is not online. RightLegRed
Joined: 02 Oct 2009
Total Posts: 6761
10 Apr 2016 06:12 PM
Well, I'm not entirely sure on what your expected output would be, I was just stating what that parameter does.
Report Abuse
DiamondBladee is not online. DiamondBladee
Joined: 24 Feb 2013
Total Posts: 3527
10 Apr 2016 06:13 PM
I'm essentially creating my own mouse.Target so I can have more leverage.
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