Set Actor Location does not work as expected for child actor component

In an environment with “simulate physics” enabled, using “set actor location” seems to cause issues with child actor components not moving correctly.

My actor A blueprint structure is as follows:

RootScene
-Cube1
–Cube2
—Cube3
–Cube4
-Cube5
–Cube6
—Cube7
—Cube8

My goal is to move the entire structure to a new location or make a rotation while maintaining their current relative positions.

Initially, all cubes have “simulate physics” enabled.

Steps taken:

  1. Disable “simulate physics” for all cubes.
  2. Move actor A using a command like set actor location(0,0,10000).
  3. Enable “simulate physics” for all cubes.

This works as expected.

However, if I encapsulate some of the cubes into an actor B and add B as a child actor component to A, parts of B do not move correctly. For instance, if I encapsulate Cube6, Cube7, and Cube8 into actor B:

RootScene
-Cube1
–Cube2
—Cube3
–Cube4
-Cube5
[–Cube6
—Cube7
—Cube8] //actorB attached as a child component

In this case, only Cube1-Cube5 move correctly, but Cube6-Cube8 do not.

Furthermore, if Cube6, Cube7, and Cube8 in actor B initially have “simulate physics” disabled, directly using “set actor location” on A moves Cube6, Cube7, and Cube8 correctly. But if I enable “simulate physics” for Cube6, Cube7, and Cube8 even once, and then they will not move correctly anymore, even if “simulate physics” is disabled.

Solutions I have found include:

  • Using physics constraints.
  • Directly calling “set actor location” on actor B.

However, these methods either require extra setup or do not handle rotation well. Is this a BUG? And is there any better way to achieve my goal?

I’d say this is a pretty standard behaviour as far as UE goes, and expected. Any simulating component has a life of its own and its transform is absolute - no longer relative to the owning actor. If you make an actor with a bunch of simulating meshes:

image

And let the simulation run, querying actor location (for example) will only return the world location of the Scene Root. Likewise, moving this actor will not affect the simulating comps. While they are owned by the actor, they are no longer attached.


I can imagine that using Child Actor Components (which are fussy and not fully fleshed out) could bring a myriad of odd and unexpected behaviours, though.

My goal is to move the entire structure to a new location or make a rotation while maintaining their current relative positions.

Run-time? In any case, you’d probably need to perform the translation without simulation running or manually, and laboriously handle the world coordinates yourself.

Thanks for your reply.

As you mentioned, once “Simulate Physics” is enabled, you cannot move the child components simply by moving the parent actor.

I realized I made a mistake in assuming that the behavior of a Child Actor Component is different from that of a Scene or Mesh Component. In fact, they behave the same way.

While the issue of “Disable Simulate Physics Works Only Once” still persists, there is no difference between Child Actor Components and Mesh Components in this regard.

To achieve group movement and rotation, my current workaround is to add multiple Physics Constraints to connect the components directly. It’s not perfect, but it works well enough for my needs.

Thanks again for your reply.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.