|
| 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
|
  |
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 10 Apr 2016 06:13 PM |
| I'm essentially creating my own mouse.Target so I can have more leverage. |
|
|
| Report Abuse |
|
|