I have a Character that gets its skeletal mesh from another character that it holds as a property. But when I try to do it the editor crashes and gives me a EXCEPTION_ACCESS_VIOLATION.
//Trying to set the mesh
AWildPokemon::AWildPokemon()
{
auto MeshComponent = GetMesh();
MeshComponent->SetSkeletalMesh(Cast<APokemonBase>(Pokemon)->GetPokemonMesh(), false);
}
//Getting the mesh
USkeletalMesh* APokemonBase::GetPokemonMesh()
{
return AlternateMeshAsset;
}
If that’s not possible what is an alternative way I could do this?