Why do meshes end up with different directions after collisions?


I have noticed some oddities with mesh collisions.

When I spawn the same static mesh at the same location (0,0,0) and use the same AddImpulse(FVector(500.0f, 0.0f, 0.0f)), what happens is that the mesh will collide with other solid meshes in different ways. For example, if I create a box geometry and I rotate it by 45 deg, then each static mesh upon collision will go in a different direction.

If the starting location, speed, and the mesh they collide with are all identical (and the collision mesh is static with no movement), then why do different instances bounce off in different directions?

I am trying to shoot multiple small particles in a row and have them bounce in identical ways, but it seems they always fly in different directions. I understand that there can be inaccuracies with calculations, but surely those inaccuracies must repeat identically given the situation remains the same?

Is there some kind of randomness behavior in UE’s collision?

There’s probably some kind of variation added to make the collision more realistic

Right. I have been trying to find a way to disable that realisticness for my specific situation. Maybe someone knows about this.

Just out of the blue:

Could gravity play into this?
Maybe after you spawn the mesh, it falls a bit before AddImpiulse takes effect, so its not from exactly (0/0/0)…
The variation could then stem from the time it takes to apply the force after spawning the actor the actor…

I have disabled gravity, collisions between them (to be sure), and modified the physics material to have no friction and restitution. I have also given them a mass of 0. They just fly forward and bounce, yet every time in different directions (slightly but visibly).

Hmm. maybe its the size of the mesh?
Havent played with it for a while, but I remember the projectiles from the FPS template (the yellow balls) have fairly consistent trajectories…

Unreal engine has non a deterministic physics engine, so what you want is Impossible unless you recode the physics engine

Its the bounce that’s catching you out, there’s always going to be deviation, variation or drift.
Suggest dropping physics and faking this instead by interping / moving the projectile manually.