|
| 10 Jan 2016 08:38 PM |
| So what's the best way to get the position of the mouse? For example, I want it to ignore invisible parts. |
|
|
| Report Abuse |
|
|
Ryuzoji
|
  |
| Joined: 21 Dec 2015 |
| Total Posts: 937 |
|
| |
|
BanTech
|
  |
| Joined: 31 Dec 2015 |
| Total Posts: 886 |
|
|
| 10 Jan 2016 08:43 PM |
| Create an ignore list of transparent parts I suppose? Then find part on ray with ignore list |
|
|
| Report Abuse |
|
|
|
| 10 Jan 2016 08:47 PM |
| That's not getting the position of the mouse... I want it to return the position behind the invisible part. |
|
|
| Report Abuse |
|
|
| |
|
|
| 10 Jan 2016 08:50 PM |
if Mouse.Target.Transparency = 1 then print(Mouse.Hit.p) end
|
|
|
| Report Abuse |
|
|
| |
|
|
| 10 Jan 2016 08:51 PM |
| That does complete opposite just from first line |
|
|
| Report Abuse |
|
|
Aethex
|
  |
| Joined: 16 Oct 2011 |
| Total Posts: 2193 |
|
|
| 10 Jan 2016 08:51 PM |
| Just use the normal method for getting the mouse's position, then make a RayCast from the camera to the mouse position after adding the mouse.Target to the "ignore list". I don't know the extent of what you want, though. If you ignore all parts, the mouse position will end up not resulting in a value because it has no endpoint (usually when it runs into a part). |
|
|
| Report Abuse |
|
|
Aethex
|
  |
| Joined: 16 Oct 2011 |
| Total Posts: 2193 |
|
|
| 10 Jan 2016 08:52 PM |
oh, just invisible ones, never mind then
check if it's invisible and add it to the ignore list before continuing to hit a part |
|
|
| Report Abuse |
|
|
|
| 10 Jan 2016 08:58 PM |
Yeah, I misread...
You want something along these lines...
local Ray = Camera:ScreenPointToRay(Mouse.X,Mouse.Y,1000)
|
|
|
| Report Abuse |
|
|
|
| 10 Jan 2016 09:01 PM |
| What if there are no parts after the transparent part? Would it return the farest it goes? |
|
|
| Report Abuse |
|
|
|
| 10 Jan 2016 09:01 PM |
1000 Is the farthest it can go.
|
|
|
| Report Abuse |
|
|
|
| 10 Jan 2016 09:10 PM |
| How do I use ScreenPointToRay? The wiki is not very descriptive. |
|
|
| Report Abuse |
|
|
|
| 10 Jan 2016 09:37 PM |
"create a 16000x16000 grid of 1px invisible gui buttons, and have each button return its position when action.onMouseOver() fires."
Don't do this ^ |
|
|
| Report Abuse |
|
|
|
| 10 Jan 2016 09:42 PM |
| You mean a 16000 X 16000 X 16000 |
|
|
| Report Abuse |
|
|
|
| 10 Jan 2016 09:57 PM |
| I made another forum post and then said to use TargetFilter. It worked :) |
|
|
| Report Abuse |
|
|