Reproducible Bug: SetRelativeLocation on a component sets the world location if the component is simulating physics.
I have a skeletal mesh that is parented to a Scene component in an actor blueprint:
My skeletal mesh component is set to not simulate physics, and I call its SetRelativeLocation(AndRotation) with all zeros every tick for this actor. I have a key press set up to toggle the component's physics simulation. The actor it belongs to is at a non-zero world location. When I run my game, the skeletal mesh is where it is supposed to be, sharing the location of the owning actor. When I press my key that toggles whether we are simulating the skeletal mesh's physics, the component teleports to world location 0,0,0. If I press my toggle key again to turn physics simulation off, the component does not return to relative location 0,0,0, but rather stays at the world origin.
I am able to reproduce this in a fresh 4.12 project, using a Static mesh instead of a skeletal mesh this time. Here is my blueprint for the actor:
Here's a link to my test project: https://drive.google.com/file/d/0B3u_hzolRrMjdXNiMUc3LW1PbHM/view?usp=sharing
Please let me know if you'd like any more information about my setup.
This is actually by design. The reason is that any object that simulates physics will detach from its parent. Physics simulation takes space in World Space, which is why it would set the world location of the object.
Have a great day
answered Sep 30 '16 at 01:04 PM
Sean L ♦♦ STAFF
Follow this question
Once you sign in you will be able to subscribe for any updates here