I am working on a game where the character (using FirstPersonCharacter) can grab boxes. I do a ray cast, and if I find a ‘Grabbable’ (an interface I added) I attach it to my character using Grab Component at Location with Rotation.
The way I have set it up is like this, whenever I ‘interact’ with the box, it is attached at a point at some distance in front of my character. That is working as intended.
However, if I am standing on the box that I am interacting with, then the box still moves correctly where it should (at some distance in front of my character) based on where I was standing, but then my character also moves on top of that box and then physics goes crazy and box and I both go flying.
What I tried: I thought it could be because while grabbing the box using that in-built function, the box might be trying to move through the character, so I tried 2 things but both did not work:
-
Increase the distance in front of the character where the box should be attached. Now the box did move far, but the character was still standing on top of it and physics went bad.
-
I thought even with the larger distance, the box might be trying to move through the character. So before attaching, I tried to set world location of the box. But as soon as I set world location of the box, my character also teleports with the box staying on top of it. And then after the grab attachment call, physics again goes weird (Tested this by adding delay between the two).
Not sure what I can try. While I was playing with some settings trying to fix it, my FirstPersonCharacter BP got corrupted, which was very difficult to find a solution for.
Edit 1: Also tried disabling Enable Physics Interaction
in the Character Movement component.