FAnimNode_RigidBody::CollectWorldObjects creates a simulation actor for each world object close to the simulation bounds. It passes `OverlapComp->GetComponentTransform()` which is the transform in world space of the world object; but `PhysicsSimulation->CreateActor` should take the transform in local simulation space, at least judging from other uses of the method.
In many cases the transform is overwritten quickly with the correct one: FAnimNode_RigidBody::UpdateWorldObjects sets a kinematic target for the actor to its transform in simulation space, and the simulation moves the actor to its target on the next step. This can still cause issues though, for example if the actor collides with something else on the same step, when it has an incorrect velocity due to the kinematic movement.
Should the actors be initialized with their transform in simulation space instead?
Steps to Reproduce
Create a scene containing an actor animated through an RBAN in the vicinity of another PrimitiveComponent and simulate.
Hi Filippo, and thank you for your question.
I’ll get this looked into and potentially raise a bug.
All the best
Geoff Stacey
Developer Relations
EPIC Games
Hi Filippo,
I’ve asked one of our support partners to repro this issue, and we are having trouble proving out the bug. Would you be able to send across a repro in a vanilla version of the engine?
Best
Geoff
Hi Geoff,
Thanks for looking into this. I’ll need to spend a bit of time on a repro, I believe the issue will be visible only if a world object collides with a bone on the first frame that it’s added to the simulation. I’ll try and get back to you.
Best
Filippo
Hi Geoff, the attached project seems to show the issue. Spawning a bone close enough to a world object so that they collide before the world object “settles” in the local simulation seems to do the trick.
Hi Filippo,
Thank you for raising this, we’ve raised a JIRA now and will take a look at it.
https://issues.unrealengine.com/issue/UE-298353
All the best
Geoff