Attach actor to component, returns true, but actor stays unchanged

Hello! I have been raking my brain since yesterday about this. I have even tried creating a new project but the attach to actor function still doesn’t seem to work (surely some sort of simple minor thing that I am missing). I basically need the player to be able to pick up an object and then place it somewhere, and it seems like Attach actor to component function is exactly what I would need for that, but no matter what it just doesn’t seem to do anything to the actor I’m trying to attach, added a print string afterwards and it returns attachment as true (and yes I have tried changing all the enums in the function, tried placing the blueprint in the actor I’m trying to attach instead of the PC, created a new project and none of it works- please help :,))

player Blueprint

actor that I’m trying to attach

print string return in pink for this function (the other true is for overlap)

socket

Hello @Headless888 ,Welcome to the forums!

In this example, I used a Sphere Collision component as the reference object. First, I applied the following settings in the Details panel, under the Collision section. Then, I replaced the DefaultSceneRoot with the Sphere Collision component, making it the new Root Component, as this helps prevent collision issues later on.

Next, I applied the following settings to the Static Mesh (in this case, a sphere).

Inside the Event Graph, we’ll create a Boolean variable called bIsGrabbed and two Custom Events: one for the Grab logic and another for the Drop logic.


( If you don’t want the object to have physics, simply remove the Set Simulate Physics node.)
Both events will have an input that stores a reference to our character. In this example, I’m using the Third Person Template, so the input type is BP_ThirdPersonCharacter Object.

OnGrab


OnDrop

After that, we’ll create two Input Actions, one for Grab


and one for Drop,

and add them to the IMC_Default. In this example, I used the same key for both actions: pressing the key once grabs the object, while holding it for 0.2 seconds drops it. If you prefer, you can also use two different keys and set both Input Actions to use the Pressed trigger.

Then inside BP_ThirdPersonCharacter, we’ll create two variables: a Boolean called bHasObject, and another variable that stores a reference to the object currently being held. This ensures that the player can only hold one object at a time. In my case, I named it CurrentObjectInHand, and its type is BP_Object, which is the name of the object’s Blueprint.

Next, we’ll create two Custom Events that will be responsible for calling the events we previously created inside BP_Object.

To finish, we’ll add the corresponding logic to each Input Action. For the Grab action, we’ll perform a Sphere Trace to detect and interact with the object. If the trace hits a BP_Object, we’ll call the Grab event. On the other hand, if the character is already holding an object, we’ll call the Drop event to release it.

I also recommend checking out this video, which explains another way to create a Pickup, Carry, and Drop System that you might find useful.

Hope it helps!

Hello! Thank you so much for your reply! It seems to work now (although not entirely as I would’ve hoped but I’ll figure it out-) do you know then if the problem was the hierarchy? The problem is that I would like for the object to have physics enabled in the beginning, but somehow the collision needs to move with the object as well.. do you perhaps have a solution or any advice for that?