DHSR
|
  |
| Joined: 08 Mar 2015 |
| Total Posts: 1424 |
|
|
| 15 Aug 2016 10:02 AM |
I've created a gun, but when I click on an area by looking over the part obstructing it, it goes right through the part (wallshooting)
What is the fix for this? Also how can I prevent shooting if the handle is obstructed? (this way you can't put your gun through the wall and shoot)
[insert lame siggy here] |
|
|
| Report Abuse |
|
|
legomada
|
  |
| Joined: 16 Jan 2009 |
| Total Posts: 652 |
|
|
| 15 Aug 2016 10:07 AM |
It's usually best to make the ray from the player's torso, rather than the handle of the gun, to prevent it from firing through stuff. The only times when this will really be visible is when you're trying to shoot something between your gun and torso (AKA never in actual combat). This is the ray, not the bullet. The bullet should still fire from the barrel. |
|
|
| Report Abuse |
|
|
c_p
|
  |
| Joined: 25 Feb 2016 |
| Total Posts: 1427 |
|
| |
|
|
| 15 Aug 2016 10:09 AM |
| the solution is to just use SMG scripts, just kidding, but the scripters forum would probably have an answer for you |
|
|
| Report Abuse |
|
|
DHSR
|
  |
| Joined: 08 Mar 2015 |
| Total Posts: 1424 |
|
|
| 15 Aug 2016 10:11 AM |
@lego that will probably fix the issue of wallshooting directly
but the issue right now is that it's wallshooting completely when I look directly over a wall even if I'm 100 studs away from the wall itself (I'm zooming out and it's shooting straight through it only when I click past the wall)
[insert lame siggy here] |
|
|
| Report Abuse |
|
|
legomada
|
  |
| Joined: 16 Jan 2009 |
| Total Posts: 652 |
|
|
| 15 Aug 2016 10:15 AM |
| Are you actually using FindPartOnRay to check whether there's anything in the way? |
|
|
| Report Abuse |
|
|
DHSR
|
  |
| Joined: 08 Mar 2015 |
| Total Posts: 1424 |
|
|
| 15 Aug 2016 10:15 AM |
Er... no.. I'm using this. local part, pos = workspace:FindPartOnRayWithIgnoreList(ray, {plr.Character, workspace.BulletDump}, false, true)
[insert lame siggy here] |
|
|
| Report Abuse |
|
|