-
Notifications
You must be signed in to change notification settings - Fork 3
Walking + Firing = Self Shooting #37
Comments
Lines 61 to 67 in d20130a
The code already avoids the first pointed thing if the ray originates from within the pointed thing. Might it be possible that the ray encounters the same object again after skipping? That's highly unlikely... Are you using the latest version (v0.24-pre) of Gunslinger? |
I cloned from the master branch 3 days ago. My version contains the code you pasted above. |
From the API docs:
This means that unless the Raycast object is re-created, it shouldn't detect the same player again and again. But there is a possibility of the ray originating from outside of the shooter's collision box due to lag (is this what you were saying?), which means the code linked in the previous post will not detect the player properly. Ideally, it's better to explicitly check for the player; I wanted to avoid string comparisons as they're computationally expensive. I'll see if there's a better way to check if an object corresponds to the shooter themselves. |
Yes, I think it could be due to lag from the time the ray is initiated to when the player moves forward and the ray progresses. |
If you walk forward and fire a weapon at the same time you shoot yourself. Is it possible to ignore the shooter when checking for hit objects or can the ray begin a bit further in front of the shooter?...
The text was updated successfully, but these errors were encountered: