I’m trying to make a grabbing system similar to the system of Amnesia. I used a gravity-gun approach, turn off gravity and interpolate the position of the object towards an attach point infront of the player camera using this snippet:
this->SetActorLocation(FMath::VInterpTo(this->GetActorLocation(), Target->ComponentToWorld.GetLocation(), deltaTime, AttachSpeed));
and this works. However if the Object is pushed against a wall and the target spot(e.g. the Cursor) moves further away the object just glitches through the wall.
What am i doing wrong?
Thanks in advance