Child Actor attached through Blueprint node not inheriting movement

(Newbie)

I’m building a simple game prototype where the player moves an actor on screen to collect other actors. When collected the actors attach to the player controlled movable actor.

As I’m testing right now balls spawn and falls with gravity. As the ball hits a collision shape on the movable actor the dropping ball is (1) set to not simulate gravity and (2) attached to actor. This puts the ball into a child of the player controlled parent.

Only problem is that the node attached actor does not move with the parent.

If I drag the same Blueprint ball to the scene, and make it a child to that same parent (by pulling it under the same player controlled actor) the child ball follows the parent.

What could be different when making an actor a child through the Blueprint node, compared to dragging it in the editor Outliner?

BP_Ball = Child made in editor
BP_Ball0 = spawn in-game and attached through node.

One difference I can see is DefaultSceneRoot is located differently:
image

image

Could that be of significance? If so, why is that happening through the attach actor node, and how do I avoid that happening?

Any suggestions on how to figure this out would be very appriciated!

Hey @G0jk3n! Welcome to the forums!

Do you think you could show your attachment code? There are some settings there you will want to make sure of- and are you using attach actor to actor, attach actor to component etc.

Typically you want to give the actor you’re attaching to some sockets, and that way the ball will have a dedicated place to stick! :slight_smile:

Thanks for guiding the detailing of my question!
Here are my nodes regarding the attachment of balls:

I’ve left an unused node just to show that I’ve tried both Attach to Actor and Attach to Component.

I’ve chosen not to use slots as I assumed I’d need to predefine where the actual attachment would occur. I’d prefer it to be more dependent on the gameplay.

Adding to this from my solution search.
if I…
add a ball to the scene,
set it’s Simulate Gravity to FALSE,
play-in-editor,
pause the game,
drag the ball under the parent: making it a child
resume play-in-editor,

The newly added ball follows the parents movement (as it should), and it also have the Sphere component as a child under the DefaultSceneRoot component:

image

Perhaps, then, it’s the spawning of the ball that is where the error happens.
And since both balls that are behaving correctly have their sphere component as child under DefaultSceneRoot, perhaps that’s what’s causing it?!

Ah. I can’t believe I overlooked that! :joy:

Yes, the Default Scene root is basically the core of the actor. The sphere is just a static mesh component, if you attach the ball to something what you’re attaching is the root, which means the root and all of its children. :slight_smile: You almost always want everything on an actor with the root as its highest parent.

I couldn’t find out why the root shifted when I had the balls spawn in-game.

As a workaround I removed the use of gravity as source of movement, and added a projectile component. Suddenly it all worked.

I’m baffled. Please to progress with the prototype, but baffled as to how gravity was involved in this.

1 Like

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