0 votes

What are the best best practices when dealing with very high velocity objects that shoot through other colliders and why do they do so in the first place.

The question has been asked before here: https://godotengine.org/qa/1250/how-to-properly-handle-high-speed-collisions

However, even though some of the answers do work, they are not 'optimal'. E.g. limiting the speed of a high velocity object seems to be a remedy but not the cure. Furthermore, I fail to see why objects shoot through colliders in the first place.

in Engine by (56 points)

2 Answers

–3 votes

The best way to avoid these problems is not to add objects to the game with high speed.

Use Project Settings -> Phisics -> fixed_fps = 120

by (208 points)
+1 vote

All the answers on that post are good for normal uses.

Godot CCD works with small objects at around 10k units/s which is really high (ray based CCD gives incorrect results but the collision point is the same as shape).

If you want insane speeds then you will have to make your own CCD technique, Godot offers many tools to do your own physics.

Why objects shoot through colliders? because of tunneling.

by (7,946 points)

A ray cast to the bullet's current velocity vector from the bullet's current location seems like the simplest and dumbest solution to tunneling.

Per frame delta, ofc.

Performance cost, no idea. Doing a ray cast every frame? pff. Doing 10k ray cast per frame, need RTX!

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.