[4.7.3] Actor::ActorLineTraceSingle doesn't work correctly in the editor

Any placed actor, moved around in the editor will report back incorrect trace hits when using
Actor::ActorLineTraceSingle().

The reason being is that when maniuplating actors in the editor, they are not considered teleports.
When UPrimitiveComponent::OnUpdateTransform() it foceablby passes false for bTeleport down to FBodyInstance::SetBodyTransform()
which if not teleporting sets the kinematic target rather that the rigid body directly.

In UPrimitiveComponent::OnUpdateTransform() there is even a comment to this point.
// @todo UE4 rather than always pass false, this function should know if it is being teleported or not!

Now when you call Actor::ActorLineTraceSingle() it eventually gets to FBodyInstance::LineTrace() which uses a PhysX
utility function to get the rigid bodie’s world position which is now stale becasue the body was not repositioned only queued to move.

What makes this even more bizzare is that the normal scene raycast functions in PhysX seem to work fine when only the kinematicTarget is set. Otherwise picking wouldn’t work in the editor at all.
I couldn’t figure out if there was way to force a physics tick that you guys were using to make that work or if PhysX sweeps the bodies when you do a scene raycast?

This issue has some overlap with an eariler bug I reported about physics sub-stepping.

Hey kylawl-

This appears to be the same issue as the one you linked to in your post and they are both being investigated together as UE-13362.

Cheers

Hi ,

Just one additional piece of info. The other bug I reported only occurs when sub-stepping is enabled where as this issue occurs regardless of the stepping mode.

Thanks,