[4.7] Simulate Physics on Static Mesh causes the mesh to translate to origin

Hi I discovered a workaround and thought of posting it here in case others find it useful. In short - calling RecreatePhysicsState() on my dynamic static mesh component fixes the origin reset issue. I’m calling it just after setting the mesh’s location but before simulating physics. May not work for all cases, but it does seem to help with a some of the physics oddities I’ve been facing with dynamic mesh components.

I discovered this when I noticed that for skeletal mesh components (which also exhibit this issue) simply resetting the collision profile to any dummy and back had the side-effect of fixing a bunch of physics issues including one where OnComponentHit wasn’t being called upon Hit. RecreatePhysicsState seems to have the same effect.

Another workaround I discovered (especially for dynamic mesh components which are spawned at runtime) is to not simulate physics at the same tick where the mesh is created. i.e you use a timer or queue-ing mechanism of some sort. This presumably gives the mesh a chance to set up its internals.

In summary - calling RecreatePhysicsState() on your mesh component is worth a shot if you’re facing weird physics bugs on dynamic mesh components. Hope this helps.

1 Like