To ensure a few things, Yes I have a socket named Weapon_Socket on my character skeletal mesh, I ensured the Collision checks are working… Spawning the mesh is fine, but when I try to Attach the mesh to the socket on the Character, It crashes the Editor.
I have tried a more simplified situation. I ensured that the CCD is off on all of the components. both the character and the object that is being touched as well… It’s still crashing the engine . here’s the basic code for the situation.
// Fill out your copyright notice in the Description page of Project Settings.
void ATesterCharacter::OnCollision(class AActor* OtherActor, class UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult &SweepResult)
AWeapon* Weapon = Cast<AWeapon>(OtherActor);
GEngine->AddOnScreenDebugMessage(-1, 4.f, FColor::Green, "HELLO IM A WEAPON!!");
void ATesterCharacter::SpawnWeapon(TSubclassOf<class AWeapon> Weapon)
AWeapon* Spawner = GetWorld()->SpawnActor<AWeapon>(Weapon);
GEngine->AddOnScreenDebugMessage(-1, 4.f, FColor::Green, "I SPAWNED");
Spawner->AttachRootComponentTo(Mesh, "Weapon_Socket", EAttachLocation::SnapToTarget);
most of the comments can only fit soo much… but relatively, It’s slimmer, but the same situation… The object spawns just fine, just wont attach to socket even the SetLocation wont work… and i turned off the CCD by unchecking the Use CCD checkmark in the collisions Here
Still at a standstill figuring out why it’s not working
Update - I tried putting the socket farther away from the mesh, and it works just fine… but I want the mesh to be attached closer because it needs to be attached to the hand Dx. even with the CCD off, it still crashes