After attaching weapon to the socket the character movements become irregular

After attaching the weapon to socket using C++ I was getting irregular charactermovement and camera becomes first person perspective from 3rd person view.I was able to spawn the weapon but after attaching it gives me bugged character movement and camera view.

	Gun = GetWorld()->SpawnActor<AGun>(GunClassReference);

	GetMesh()->HideBoneByName(TEXT("weapon_r"), EPhysBodyOp::PBO_None);

	Gun->AttachToComponent(GetMesh(), FAttachmentTransformRules::KeepRelativeTransform, TEXT("weaponSocket"));
	Gun->SetOwner(this);

Bugged it how?

1 Like

When I move forward with Gun attached to the socket the character moves left and camera view changes to first person view automatically.I resolved it by using already attached gun in wraith skeletal mesh by using the Muzzle_01 socket as Raycast origin point

Privacy & Terms