Bug get Relative Location return the to world location

Hello,

Here is a bug I found (and if it’s already known how to work arround ?)

Steps to create the bug (even in a blank project):

  • Create a blueprint Actor.
  • Attach a static mesh (like a box) to the root.
  • Create a event tick and print the relative location
  • Launch the game : It works and print 0 / 0 / 0.
  • Now enable physics on the box
  • Launch the game : it print the world location instead of the relative.

Is there something I don’t understand or I did something wrong ?

Thanks.

Hey Diem,

This is intended behavior. This is because when you Simulate Physics on a component, it detaches from its parent and the simulation then takes place in world space. So when you’re returning the relative location of a component that is simulating physics, you are returning its location relative to the world.

Have a great day

1 Like

Hey Flint,

Thank’s for your answer now I understand what was going on.
It’s a bit annoying if I want to use the “Physics constraint” component and calculate the relative location.

Have a great day too