How do I keep the world position of a child component unchanged when I move the character?

So normally when I want to move a parent component without moving its child component I move the parent by some vector and then I move the child by the opposite of that vector and this works great, the parent moves and the child component stays in place relative to world space.

However, in this case I am wanting to keep a child component of a character BP in the same place after I apply movement to the character. Specifically the problem seems to be that the Add Movement Input node does its calculations after the event tick (which is where I am working in). I have even tested this by checking the difference between the character’s location before and after the Add Movement Input node and there is no difference between the values before and after. This tells me that all the physics updating for the character movement probably happens after the event tick is finished.

So I’m wondering, is it possible to figure out how to apply the opposite effect of my Add Movement Input node to a child component so that it does not move with the character, or is there any way to keep my child component in the same place after I move the character with the Add Movement Input node?

Also, do all of the Add Movement Input nodes get applied at the same time? Because I want to counteract the input from a single node I am using, I don’t want to counteract every single Add Movement Input node. I specifically need to ignore the input from one of several of these nodes.

I don’t believe you’ll be able to ignore one node and not another since (from my understanding) the movement component will compile all the received inputs and use its internal logic to change its state based upon all of them. I don’t think they’re separate forces that can be independently applied or ignored.

Depending on the context, perhaps you could use nested actors with different movement components. You could add a child actor component to the class you’re using, and make a new actor with a movement component to use as that child actor. Put any components that you want to be affected by all movement in the child actor, and any you want to potentially ignore some movement in the parent actor. This way you could apply input to the parent movement component to apply it to every component and to the child one to apply it to just the ones in the child actor.

I haven’t tested this though so unsure how it would go.

I ended up solving my problem by avoiding the use of the Add Movement Input node entirely and coming up with a different solution by setting the position of the character manually with Add Actor World Offset node. It does seem that Baeldan was right in that all the movement input nodes are likely all summed together at once. What I was asking for was probably not the intended use of the Add Movement Input node.

Thanks for the reply! I ended up going with a solution that doesn’t require the movement input node, but I still appreciate the help.

I had the use case of a moving pawn with a camera component. I wanted the camera component to not change its world location.

You can do it easily by using SetAbsolute either in code or blueprint. Here is how I do it in my construction script:

setabsolute

What’s then left to do is to drag the Pawn into the level editor and position the camera component by hand.