Hey there,
So I have my character that picks up weapons when looking at it by attaching it to a socket and snapping it to the socket. What happens is that if the weapon is below the player, it pushes the character up. What I am hoping to do, is lock the player in place but only in the Y(Z) direction. I am not exactly sure how to go about doing this. Maybe limiting the players Z Velocity?
This is how i snap the target:
void APlayerCharacter::Use(AUsableItem* curItem, FName Socket){
curItem->getItemMesh()->SetSimulatePhysics(false);
curItem->SetActorEnableCollision(false);
curItem->getItemMesh()->SetCollisionProfileName(TEXT("NoCollision"));
curItem->getItemMesh()->AttachTo(GetMesh(), Socket, EAttachLocation::SnapToTarget, true);
}
Any help is appreciated, thanks