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: Using mouse.Hit position to move object, but one problem.

Previous Thread :: Next Thread 
Integer_overflow is online. Integer_overflow
Joined: 16 Feb 2010
Total Posts: 6712
12 Jun 2017 02:51 AM
When the mouse stays still, the object moves closer and closer to the camera. Does anyone know a fix for this?


Report Abuse
freeroblox1234567 is online. freeroblox1234567
Joined: 19 May 2011
Total Posts: 120
12 Jun 2017 02:56 AM
Mouse.TargetFilter = (the object)
Report Abuse
freeroblox1234567 is online. freeroblox1234567
Joined: 19 May 2011
Total Posts: 120
12 Jun 2017 02:58 AM
Nevermind, hit ignores targetfilter
Report Abuse
Disillusions is not online. Disillusions
Joined: 10 Jul 2011
Total Posts: 6365
12 Jun 2017 03:00 AM
No, that works ^. If you want to ignore other instances as well, use the UnitRay of the camera and cast a ray with an ignore list instead.


Report Abuse
Integer_overflow is online. Integer_overflow
Joined: 16 Feb 2010
Total Posts: 6712
12 Jun 2017 03:03 AM
Nope, didn't work unfortunately, it is still doing the same thing.


Report Abuse
Disillusions is not online. Disillusions
Joined: 10 Jul 2011
Total Posts: 6365
12 Jun 2017 03:05 AM
Try the raycasting way?


Report Abuse
Integer_overflow is online. Integer_overflow
Joined: 16 Feb 2010
Total Posts: 6712
12 Jun 2017 03:08 AM
Never used it actually, how does it work?


Report Abuse
Disillusions is not online. Disillusions
Joined: 10 Jul 2011
Total Posts: 6365
12 Jun 2017 03:15 AM
wiki.roblox.com/index.php?title=API:Class/Mouse/UnitRay

Make a new ray from the origin going in the ray's direction multiplied by the max distance you want to detect hits from. Then just use workspace:FindPartOnRayWithIgnoreList and put the object(s) you want to ignore in the list


Report Abuse
Integer_overflow is online. Integer_overflow
Joined: 16 Feb 2010
Total Posts: 6712
12 Jun 2017 03:20 AM
Thank you! I figured out what was wrong with my code that used TargetFilter, but I will remember UnitRay. Thank you guys for the help!


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