Comments (4)
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?
from gunslinger.
I cloned from the master branch 3 days ago. My version contains the code you pasted above.
It only happens when walking forward so maybe due to lag from the time the check is done to when it continues to trace?
from gunslinger.
From the API docs:
The map is loaded as the ray advances. If the map is modified after the
Raycast
is created, the changes may or may not have an effect on the object.
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.
from gunslinger.
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.
from gunslinger.
Related Issues (20)
- Use deferred raycast to accurately replicate behaviour of projectile entity HOT 1
- Improve textures (incl. builtin guns, ammo, etc.) HOT 2
- Split shotgun-style fire (`splash`) from `mode` HOT 3
- Add support for weapon add-ons like scopes, suppressors, and extended mags
- Implement weapon inaccuracy HOT 5
- Ammo is still non-existent HOT 1
- Add more builtin guns
- Play sounds on more events HOT 1
- (Ab)use HUD elements to the maximum
- Add support for manual reloading
- (Ab)use stack count display in item slots to display size of clip
- Entity-based projectiles is inevitable... HOT 7
- Use Progressive Raycasting instead of Deferred Raycasting. HOT 7
- Trigger callbacks when projectile hits a target
- Convert to modpack; add builtin guns as separate mod HOT 1
- Fix credits
- Automatic guns can "reload" twice
- Crash on shoot HOT 3
- Duplication Glitch HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gunslinger.