Komnenos
|
  |
| Joined: 25 Jan 2011 |
| Total Posts: 8299 |
|
|
| 25 Oct 2014 11:42 PM |
Is there any way to make the raycast originate from the tip of the gun rather than in the middle of my arms? The Handle is in the middle of my arms and the Barrel is the part I want the raycast to shoot from (on the end of the gun, the muzzle).
Here's what I see:
local function fire(aim, mouse) local origin = handle.Position local distance = (origin-aim).magnitude local minSpread, maxSpread = -(spread/100)*distance, (spread/100)*distance
I have tried changing "handle.Position" to "script.Parent.Barrel.Position". This works when shooting the gun at anything but an actual person in which it does not work. The gun refuses to shoot and I must hit backspace to reset its functionality.
Night C&G help me |
|
|
| Report Abuse |
|
|
Komnenos
|
  |
| Joined: 25 Jan 2011 |
| Total Posts: 8299 |
|
| |
|
Osyris
|
  |
| Joined: 27 Oct 2007 |
| Total Posts: 4321 |
|
|
| 25 Oct 2014 11:46 PM |
| Sure it's possible, but I'm like 90% sure they did that because they had no better way to stop "wallshooting". |
|
|
| Report Abuse |
|
|
Komnenos
|
  |
| Joined: 25 Jan 2011 |
| Total Posts: 8299 |
|
|
| 25 Oct 2014 11:48 PM |
I don't really care if the gun wallshoots or not, I just want to have the gun shoot and be able to hit and damage people from the tip rather than my torso.
I have the first condition met, but it refuses to hit and damage people based on an "origin" change alone. |
|
|
| Report Abuse |
|
|
Komnenos
|
  |
| Joined: 25 Jan 2011 |
| Total Posts: 8299 |
|
| |
|
Komnenos
|
  |
| Joined: 25 Jan 2011 |
| Total Posts: 8299 |
|
| |
|
thea96
|
  |
| Joined: 09 Feb 2011 |
| Total Posts: 37634 |
|
| |
|
Osyris
|
  |
| Joined: 27 Oct 2007 |
| Total Posts: 4321 |
|
| |
|
Komnenos
|
  |
| Joined: 25 Jan 2011 |
| Total Posts: 8299 |
|
|
| 25 Oct 2014 11:59 PM |
| Can you explain where to put that and what exactly to type as if you were attempting to explain it to someone with down's syndrome? |
|
|
| Report Abuse |
|
|
thea96
|
  |
| Joined: 09 Feb 2011 |
| Total Posts: 37634 |
|
| |
|
Komnenos
|
  |
| Joined: 25 Jan 2011 |
| Total Posts: 8299 |
|
|
| 26 Oct 2014 12:04 AM |
| Where would I put that? Thank you for the help so far |
|
|
| Report Abuse |
|
|
thea96
|
  |
| Joined: 09 Feb 2011 |
| Total Posts: 37634 |
|
|
| 26 Oct 2014 12:06 AM |
| i was joking please never ever put what i just said into any script |
|
|
| Report Abuse |
|
|
Komnenos
|
  |
| Joined: 25 Jan 2011 |
| Total Posts: 8299 |
|
|
| 26 Oct 2014 12:08 AM |
| God damn it thea why you gotta go and do this to me |
|
|
| Report Abuse |
|
|