Can't Grab Component At Location, gets transported to 0,0,0 instead.

I made a static mesh blueprint actor (paper) that can be grabbed by a grabber and placed inside another static mesh blueprint actor (chamber) when you hold it in your hand and click on the chamber.

The picking up and inserting works without issue. The problem arises when I run the code to detach the paper from the chamber and try to call Grab Component at Location with Rotation from the Physics Handle component.

For whatever reason, after I detach the actor and call Grab Component, it runs both of those nodes. But when I try to print out the grabbed component directly after, the physics handle doesn’t actually have the grabbed component inside. Does it fail silently?

The input to Grab Component at Location with Rotation is of type “Primitive Component Object Reference”, whereas my component to grab is of type “Static Mesh Component Object Reference”.

This is what my paper blueprint looks like (the one I’m detaching and trying to grab)

When this is initially grabbed, it grabs it by the Box Trigger Volume.

This is the code that runs when the paper is being taken out.

This code lives in the chamber blueprint, which looks as follows:

The Target of Detach is the Physics Handle on my player character that comes from a BPI_Interaction interface. The Paper Slot is the Static Mesh Component of the paper that needs to be taken out. The print at the end of the exec runs no problem, so I know Detach and Grab get called. It’s just that once I go through my process of placing the paper inside the chamber and pulling it out, it goes to 0,0,0 in the level instead of the Physics Handle.

I hope this video actually works.

Try using “Keep World” instead of “Keep Relative” in all your attachment/detachment functions.

1 Like

I managed to get it in front of the camera by using a function that I define in a function library:

I did first set the Detach Rules to Keep World but then I set the location with the above function directly after.

It still doesn’t move though even after I grab it, so I figured: What if the previous attachment disables “Simulate Physics” or “Movable”?

Turns out that Simulate Physics needs to be deactivated. (I ejected with F8 while playing and then searched for the paper object in the outliner)

The problem is the following: I explicitly add a Set Simulate Physics which is set to True after the the Detach and Set Location, but when I eject again to see if it actually set Simulate Physics to True, it doesn’t do it. The paper just hangs in mid air in front of me.

So now I am at a complete loss…

I tell him to simulate Physics but it doesn’t do it. Does it apply the Simulate Physics to the wrong component in the Actor hierarchy? What is going on here?

EDIT:
I checked every component in the outliner and all of them have Simulate Physics set to False.
image

Does it do it for one tick but then it switches back? Can I not use the paper slot reference to set simulate physics after Detachment? Does Grab Component at Location with Rotation change the Simulate Physics boolean somehow?

Hmm it looks like you are attaching the Paper to PaperSlot component in the chamber, but then you are detaching PaperSlot instead of detaching Paper. So it works once but then it’s in a messed up state because your chamber no longer has the PaperSlot.

In the chamber BP you should keep a reference to the attached Paper, and detach that instead of detaching PaperSlot. Or use PaperSlot->GetAttachChildren to get the paper.

still doesn’t work…

I don’t even know if a component slot and the actor inside it can be really differentiated in Unreal. All I want is to place a Blueprint Actor on another Blueprint Actor at a predetermined location and the detach it again. That cannot be that difficult, right?