Dear Friends at Epic,
I’ve encountered what appears to me as some sort of massive collision bug when it comes to dynamically spawning Static Mesh Actors that are using Auto-Convex-Created Collision
This does not occur with simply dragging the Static Mesh Asset into the level
I am spawning the Static Mesh Actor through code similar to this:
AVictoryBCSpike* NewSpike =
GetWorld()->SpawnActor(
VictoryPC->BCSpikeBP, GetActorLocation() , FRotator::ZeroRotator, SpawnInfo );
VictoryBCSpike derives from Static Mesh Actor and has a blueprint in the editor (BCSpikeBP) that has collision BlockAll and Full Collision Enabled
#Dynamically Setting Mesh Too
It is worth noting that I am also dynamically setting the static mesh asset during runtime as well:
void AJoySMA::OnRep_SetMesh()
{
LoadedMeshPtr = NULL;
LoadedMeshPtr = UVictoryCore::VictoryLoadMesh(MeshRef);
StaticMeshComponent->SetStaticMesh(LoadedMeshPtr);
}
UStaticMesh* UVictoryCore::VictoryLoadMesh(FName Path)
{
return Cast(StaticLoadObject( UStaticMesh::StaticClass(), NULL,*Path.ToString()));
}
#Only New Collision Creation Affected
It is also worth noting that assets I created auto convex collision for in Beta4 still work correctly now in Beta5
But if I try to create new auto convex collision, they are consisently not having collision in-game using my spawn->set static mesh asset method
#Tests Done With Multiple Different Static Meshes
-
If I use 6 sided simple collision (box) the collision works fine as default / simple collision
-
if I use complex as simple collision (with no simple collision hulls), everything works perfectly
-
if I use auto convex collision with a variety of settings, the spawned SMA does not have collision
#Repro
Repro would involve
- spawning a SMA during run-time
- setting the static mesh asset during run time right after spawning it
#Drop Box
I have posted an example asset I am having issues with on drop box
NathanLyer/SimpleCollisionBugTest.FBX
#Did not Happen in Beta4
I never had issues with this process in Beta4 and my code involved has not changed in Beta5
I had used auto convex many times, which is why I am so surprised the process is not working now
#WorkAround
In order to re-enable collision for my Static Mesh Assets for use with my system of spawning during runtime and setting the mesh during run time,
I must change all of my assets to using Complex As Simple until this issue is resolved.
#Summary
I bring this issue to you with confident urgency mainly because I experienced no issues with this process of spawning and setting static mesh asset dynamically in Beta4.
Thanks!
Rama
