Projectiles too fast for Physics

hey guys,

I’m having a problem with projectile physics.

The projectiles in my game are very fast, so fast in fact, that OnTriggerEnter events, are recognized too late sometimes, and the bullet is technically able to fly through a thin wall.

Heres an example code:

void OnTriggerEnter(Collider other)

is there any way to speed up the collision detection with OnTriggerEnter. So that the collision calls are framerate independent?

The projectile is moved like this btw. (2D game):

transform.Translate(Vector3.up * Time.deltaTime * speed);

I thank you very much.

Perform a ray cast from the position the projectile is now, to where it’ll be in the next frame. If the ray hits anything, then so will the projectile. You can use the distance along this ray where the collision occurs to tell you when the bullet would hit.

Can look at / read the CollisionDetection options in the rigidbody, to force it to check “in between” frames.

But, if it’s going that fast, it may not look good anyway, and the raycast method may be better.

I found a more simple approach, which seems to get the job done.
I basically just made the OnTriggerEnter event a coroutine, which works with Fixed Update:

IEnumerator OnTriggerEnter(Collider other)
		yield return new WaitForFixedUpdate();
		if (WALL)

on top of that, I reduced the Fixed Timestep in the Timemanager to 0.005.
Now no bullet flies through a thin object anymore.

But I might go back to the raycast method, if this approach doesnt work over the long run.

But thanks to all of you, for the suggestions.