Root component not following child mesh

Hello,

I’m having quite problem with player character actor. I have components in blueprint configured like below:

#|RootScene
##|| PlayerMesh (child of root)
##|| SphereMesh (child of root)
##|| || Camera (child of Sphere)

When I set velocity to the PlayerMesh I expected movement of whole character but I can see my PlayerMesh floating away. I can use “SetLocation” to move RootScene to the place where the PlayerMesh is, but I suppose it shouldn’t work like that? Am I missing something here?

1 Like

The location of the root scene does not change unless you specifically change the actor location. Everything inside the actor with physics enabled will only update it’s own position and all it’s children, the root of the actor will stay stationary, as will all other components in the actor.
So if you have two physics enabled objects in an actor you should regard them as two seperate entities that have their own location.
In your specific case, you probably want to attach the camera to the playermesh (camera should be a child of playermesh). The the camera will move along with the playermesh.

Another thing: if you want the actor to move along with something that has physics enabled, then that physics enabled component should be the root of the actor (delete the root scene). So if you make the playermesh the root component of the actor, then everything else will move with it.

2 Likes

Thank you very much for answer. This explains a lot.

I want to camera move independently of PlayerMesh or with it (as player choose) so I figured out to add a new scene component as root and change parent of Sphere (which controls rotation around the object). But then everything went wrong. :slight_smile:

Your answer made me understand how the parenthood here works and I couldn’t figure it on my own without help. So thank you very much again.