I’m doing this:
but setting it to false doesn’t seem to revert what has been done by SetSimulatePhysics(true) to 100%, because before I set it to true, I can do this:
MyCubeObject->AttachRootComponentTo(SomePawn->GetMesh(), NAME_None, EAttachLocation::SnapToTarget) ; which is not possible after setting SetSimulatePhysics(false).
To clarify: I want to have a static cube in the map, pick it up so it is attached to my pawn. Then I can press a button and throw it into the world, while activating physics so it looks like I threw a box in front of me.
This works, but if I touch the box afterwards to pick it up again, I cannot attach it to my pawn again.
To me it seems like SetSimulatePhysics(true) is doing something to my mesh that I cannot revert. I’m using DetachRootComponentFromParent() before trying to re-attach of course.
If I try to attach the cube again after I dropped it, it relocates to some point in the middle of the map and stays there instead of moving with my pawn, above the head of the pawn.
Does anyone have an idea?