Relative Location showing different values (Play in Editor/Packaged game)

So I’ve come across something very weird.
Whenever I have a static mesh component on a blueprint set to simulate physics, the values of the relative location on the packaged project (WindowsNoEditor mode) are messed up.

Here is my setup:

Event Graph of the blueprint:

When I press the ‘E’ key playing on the editor, I get “X=0.000 Y=0.000 Z =0.200”, which is the expected value.
But when I launch the level (WindowsNoEditor platform) I get “X=370.001 Y=-0.000 Z =20.173”

Am I doing something wrong or is it a bug?

Thanks.

#Get World Location

Get relative location wont have any useful meaning for an object that is simulating physics, as it goes into its physics instance and moves far away from the owning actor.

Instead use Get World Location

This is absolute real world position, and should be consistent for you in PIE and packaged builds.

It’s also much more useful information, telling you where the physics object actually is in the world!

#:heart:

Rama

PS:

If you really need to know how far apart the physics instance is from its own actor after entering physics, use

(GetActorLocation() - YourComponent->GetWorldLocation()

Thanks for the explanation, Rama.
It worked great!

Thanks for pointing this out - I was having a similar issue where I added a component with a relative transform, then started simulating physics. I changed the relative location actions to world location and everything works now!