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
We use cookies to offer you a better experience. By using Roblox.com, you are agreeing to our Privacy and Cookie Policy.
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: is there a way to fix this? mouse.hit issue

Previous Thread :: Next Thread 
Lord_Narwhal is not online. Lord_Narwhal
Joined: 05 May 2012
Total Posts: 3242
25 Jul 2016 05:12 PM
so i currently have a bow that shoots based off of the bow's lookvector

which works since my char rotates relative to the mouse

i wanted to use the mouse's position for accuracy reasons

but here's what happened

i used the mouse's x, the char torso's y(to keep it at the same level) and the mouse's z

at super close range, the arrows go all over the place

not sure why


Add 13,000 posts
Report Abuse
AggressiveCatch is not online. AggressiveCatch
Joined: 17 Jul 2011
Total Posts: 5840
25 Jul 2016 05:14 PM
mouse.TargetFilter = char + bow?
Report Abuse
Lord_Narwhal is not online. Lord_Narwhal
Joined: 05 May 2012
Total Posts: 3242
25 Jul 2016 05:15 PM
@Aggressive

stupidly i never tried that

brb


Add 13,000 posts
Report Abuse
Lord_Narwhal is not online. Lord_Narwhal
Joined: 05 May 2012
Total Posts: 3242
25 Jul 2016 05:20 PM
that failed


Add 13,000 posts
Report Abuse
direMitten is not online. direMitten
Joined: 18 Jun 2015
Total Posts: 1294
25 Jul 2016 05:38 PM
Surely you didn't ACTUALLY do

mouse.TargetFilter = character + bow

? Because that would throw an error.

You'll have to put everything you want the mouse to ignore inside a shared ancestor. Alternatively, manually cast a ray with origin and direction identical to mouse.Ray, and then use game.Workspace:FindPartOnRayWithIgnoreList.
Report Abuse
Lord_Narwhal is not online. Lord_Narwhal
Joined: 05 May 2012
Total Posts: 3242
25 Jul 2016 05:39 PM
@dire

no, just the character, which has the bow in it(in the humanoid, since i used EquipTool)




Add 13,000 posts
Report Abuse
Lord_Narwhal is not online. Lord_Narwhal
Joined: 05 May 2012
Total Posts: 3242
25 Jul 2016 06:15 PM
anyone?

seems like it's on roblox's end

unless someone knows why


Add 13,000 posts
Report Abuse
Lord_Narwhal is not online. Lord_Narwhal
Joined: 05 May 2012
Total Posts: 3242
25 Jul 2016 06:46 PM
b


Add 13,000 posts
Report Abuse
Lord_Narwhal is not online. Lord_Narwhal
Joined: 05 May 2012
Total Posts: 3242
25 Jul 2016 06:50 PM
found the issue

the torso's Y position messes up




Add 13,000 posts
Report Abuse
Dominical is not online. Dominical
Joined: 04 Nov 2011
Total Posts: 1303
25 Jul 2016 06:53 PM
Just use the mouse's lookVector property.

local constantSpeed=300
arrow.Velocity = mouse.Hit.lookVector * constantSpeed


Report Abuse
Lord_Narwhal is not online. Lord_Narwhal
Joined: 05 May 2012
Total Posts: 3242
25 Jul 2016 06:54 PM
@Dominical

it has to be on a flat plane though


Add 13,000 posts
Report Abuse
Dominical is not online. Dominical
Joined: 04 Nov 2011
Total Posts: 1303
25 Jul 2016 07:05 PM
What do you mean? So the arrow goes straight?


Report Abuse
Dominical is not online. Dominical
Joined: 04 Nov 2011
Total Posts: 1303
25 Jul 2016 07:11 PM
Just add a body force.


Report Abuse
thedailyblarg is not online. thedailyblarg
Joined: 26 Feb 2012
Total Posts: 5506
25 Jul 2016 07:13 PM
You can cast rays and make the arrow travel in a path by using its direction and speed and detecting if the ray hits something
Report Abuse
Lord_Narwhal is not online. Lord_Narwhal
Joined: 05 May 2012
Total Posts: 3242
25 Jul 2016 07:33 PM
it works now, i just used a constant instead of torso.Position.Y so it can't glitch out


Add 13,000 posts
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