Not sure if that properly describes it but I have a drawer that open with a timeline. I want to put a pickup item in the drawer that stays attached to the drawer as it opens. Right now I have the pickup item parented to the drawer but it doesn’t move when the drawer opens. I added a socket to the drawer mesh thinking I can use that somehow but don’t see how to attach the pickup item to the socket.
Ok so the Drawer probably has a StaticMeshComponent, right?
The Pickup Actor might get spawned inside of the Drawer Blueprint or somewhere you can access the reference of the Drawer and the Pickup at the same time.
Now you would call “Attach to Component” on the Pickup Actor and use the StaticMeshComponent as a Parent.
You would also want to enter the Socket Name, you added to the Static Mesh, here.
Then you might want to call “SnapToTarget” so it gets set to the Rotation and Location of the Socket.
Now you should check the boolean at the bottom, which is something like “Weld Simulated Bodies”, so they are
connect to each other.
You don’t need physics to be true afaik. But it should be set to moveable, i guess.
I added Attach to Component inside the drawer bp with a variable called contents and then attached the pickup item with that. It works! except I get an error because it gets destroyed when I pick it up but the drawer is still looking for it
Use the “IsValid” node to make sure references are only used when they are valid (:
Awesome! Thanks very much eXi. That did it.