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: Best Way to Get Position Of Mouse

Previous Thread :: Next Thread 
Crazy010517 is not online. Crazy010517
Joined: 17 Sep 2011
Total Posts: 1161
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 is not online. Ryuzoji
Joined: 21 Dec 2015
Total Posts: 937
10 Jan 2016 08:41 PM
Raycast
Report Abuse
BanTech is not online. 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
Crazy010517 is not online. Crazy010517
Joined: 17 Sep 2011
Total Posts: 1161
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
MahouReikon is not online. MahouReikon
Joined: 15 Feb 2014
Total Posts: 1359
10 Jan 2016 08:48 PM
Yes it does
Report Abuse
getSolution3 is not online. getSolution3
Joined: 28 Aug 2010
Total Posts: 1132
10 Jan 2016 08:50 PM
if Mouse.Target.Transparency = 1 then
print(Mouse.Hit.p)
end


Report Abuse
getSolution3 is not online. getSolution3
Joined: 28 Aug 2010
Total Posts: 1132
10 Jan 2016 08:50 PM
==*


Report Abuse
MahouReikon is not online. MahouReikon
Joined: 15 Feb 2014
Total Posts: 1359
10 Jan 2016 08:51 PM
That does complete opposite just from first line
Report Abuse
Aethex is not online. 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 is not online. 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
getSolution3 is not online. getSolution3
Joined: 28 Aug 2010
Total Posts: 1132
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
Crazy010517 is not online. Crazy010517
Joined: 17 Sep 2011
Total Posts: 1161
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
getSolution3 is not online. getSolution3
Joined: 28 Aug 2010
Total Posts: 1132
10 Jan 2016 09:01 PM
1000 Is the farthest it can go.


Report Abuse
Crazy010517 is not online. Crazy010517
Joined: 17 Sep 2011
Total Posts: 1161
10 Jan 2016 09:10 PM
How do I use ScreenPointToRay? The wiki is not very descriptive.
Report Abuse
Quentonious is not online. Quentonious
Joined: 26 Sep 2008
Total Posts: 3036
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
MahouReikon is not online. MahouReikon
Joined: 15 Feb 2014
Total Posts: 1359
10 Jan 2016 09:42 PM
You mean a 16000 X 16000 X 16000
Report Abuse
Crazy010517 is not online. Crazy010517
Joined: 17 Sep 2011
Total Posts: 1161
10 Jan 2016 09:57 PM
I made another forum post and then said to use TargetFilter. It worked :)
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