How to move spawned Actor with attached component?

Hi guys!

In my game I have a table with a Drawer. When I interacted with a Drawer - it spawn some loot inside (as Actor. I’m using “Spawn Actor”) and after a Drawer is move to open itself. The Loot without simulate physics. I used “Attach Actor to component“ with “Rules: Keep Relative (or Snap to Target)”.

The Loot spawned, but not moving with a Drawer. How to fix it?

Hi,

So far so good.

Spawn actor-> AttachActorToComponent → Socket ? // did you define a socket on drawer moving with the drawer either with bone or manual?

Yeah, tryied attach in Socket of Moving mesh. Doesn’t work. An Item can spawn in Socket location, but not moving too =(

Thats great, let’s debug together. Probably a small culprit here which is fun to solve :slight_smile:

  • We know item is there where it should be.

How you do the move? Is it skeletal mesh or static mesh?

Skeletal Mesh - > Check if the bone movement effecting all vertex as it should.
Static Mesh → Assuming its a timeline movement-> Drawer Mesh component → Print socket location to see if socket is moving or not. Also when attaching “weld simulaties bodies false” just to be sure.

I’m using “Move Component to“ for component. Heard it better when using Timeline + Set actor world location. Component is just Static Mesh.

Now I tried Timeline - but same old issue.

I think “Attach Actor to component” doesn’t mean it added Spawned actor as Child for Moving Component, which wierd (I thought it is main purpose for this node). For tests, I just added to moving Component some Text Render and Text render moving with Component.

Something like this should work.

A simple open close timeline for me. You can do logic like., 0 - 1 lerp, open play from start, close reverse from end or however you see fit. This is for just demo.

this is basically your drawer and its socket if static mesh

1

Similarly there is nothing wrong with using move component to

Make sure your attachments are right. not to the root component and its on the parent side. Since your problems origin is from there I feel.

Oh my, looks great. But idk why, it won’t work on me xD

But I found the way as insiration of yours.

I changed “Actor to Component” as “Component to Component” and found current mesh and now it works.

Perhaps reason is: what first in “item“: Mesh or Root component (not sure).

Thank you for helping, friend!

p.s. if you can tell me how you mad this sharp lines - it will be great. Looks amazing xDDDDD