Hi,
I am trying to attach a Static Mesh of a weapon to my Actor characters socket.
ASCharacter* Pawn = Cast<ASCharacter>(InstigatorPawn);
if (Pawn)
{
USkeletalMeshComponent *Character = Pawn->GetMesh();
MeshComp->AttachTo(Character, "Weapon", EAttachLocation::SnapToTarget);
}
Instead of attaching it to the socket, when i go to pick up the weapon i placed in game it falls back on the ground in a different location.
Kris
(Kris)
March 29, 2015, 4:28pm
2
It sounds like the static mesh in question still has physics enabled.
If so, make sure to disable that first.
Otherwise, need more information
@Kris
How do i disable the physics of the static mesh?
Believe me there is nothing more to it. Im just trying to Attach a static mesh to an actors socket.
Update:
@Kris ty. I figured it out.
MeshComp->SetSimulatePhysics(false); // Fixes Issue of not attaching
MeshComp->SetCollisionEnabled(ECollisionEnabled::NoCollision); // Fixes issue of weird movement after attaching mesh.