A Big Collision Bug - Spawned SMAs with Auto Convex Collision, Collision Doesnt Work In-Game

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

Hey Rama,

I wasn’t able to reproduce the described bug in latest-main. I assume it has been fixed already. The coming rocket beta build should therefore contain the fix. Please let me know if not.

Cheers,
Martin

Dear Martin,

Yes I can verify that spawned static meshes collision is working again,

however perhaps related to that fix is a new issue, where the game hangs for 1-2 seconds after dynamically spawning a static mesh actor.

It seems related to Landscapespline.cpp

I do have a landscape actor in my level at the time of spawning

It happens on every spawn and is a prohibitive issue, meaning it is stopping my game from working since I need to spawn static mesh actors very frequently and cannot deal with the long hang

Here’s the log for that:

2013.12.17-14.04.12:499][   ]LogOutputDevice: === Handled error: ===
Ensure condition failed: StaticMesh [File:D:\BuildFarm\buildmachine_++depot+UE4-Rocket+Beta6\Engine\Source\Runtime\Engine\Private\Landscape\LandscapeSplines.cpp] [Line: 2221]

Stack: Address = 0xdb9f3156 (filename not found) [in C:\Program Files\Rocket\Engine\Binaries\Win64\RocketEditor-Core.dll]
Address = 0xdb8eb8e2 (filename not found) [in C:\Program Files\Rocket\Engine\Binaries\Win64\RocketEditor-Core.dll]
Address = 0xdb7e7699 (filename not found) [in C:\Program Files\Rocket\Engine\Binaries\Win64\RocketEditor-Core.dll]
Address = 0xda453a61 (filename not found) [in C:\Program Files\Rocket\Engine\Binaries\Win64\RocketEditor-Engine.dll]
Address = 0xda2545c9 (filename not found) [in C:\Program Files\Rocket\Engine\Binaries\Win64\RocketEditor-Engine.dll]
Address = 0xda1fbb3a (filename not found) [in C:\Program Files\Rocket\Engine\Binaries\Win64\RocketEditor-Engine.dll]
Address = 0xda1dfbbe (filename not found) [in C:\Program Files\Rocket\Engine\Binaries\Win64\RocketEditor-Engine.dll]
Address = 0xda1e182b (filename not found) [in C:\Program Files\Rocket\Engine\Binaries\Win64\RocketEditor-Engine.dll]
Address = 0xda1e1b86 (filename not found) [in C:\Program Files\Rocket\Engine\Binaries\Win64\RocketEditor-Engine.dll]
Address = 0xda239396 (filename not found) [in C:\Program Files\Rocket\Engine\Binaries\Win64\RocketEditor-Engine.dll]
Address = 0xd9ddc7d0 (filename not found) [in C:\Program Files\Rocket\Engine\Binaries\Win64\RocketEditor-Engine.dll]
Address = 0xd9c3818a (filename not found) [in C:\Program Files\Rocket\Engine\Binaries\Win64\RocketEditor-Engine.dll]
Address = 0x3f368edc (filename not found) [in C:\Program Files\Rocket\Engine\Binaries\Win64\RocketEditor.exe]
Address = 0x3f35e8dc (filename not found) [in C:\Program Files\Rocket\Engine\Binaries\Win64\RocketEditor.exe]
Address = 0x3f35e94a (filename not found) [in C:\Program Files\Rocket\Engine\Binaries\Win64\RocketEditor.exe]
Address = 0x3f36a73b (filename not found) [in C:\Program Files\Rocket\Engine\Binaries\Win64\RocketEditor.exe]
Address = 0x3f36b3ef (filename not found) [in C:\Program Files\Rocket\Engine\Binaries\Win64\RocketEditor.exe]
Address = 0x7750652d (filename not found) [in C:\Windows\system32\kernel32.dll]
Address = 0x7763c521 (filename not found) [in C:\Windows\SYSTEM32\ntdll.dll]
Address = 0x7763c521 (filename not found) [in C:\Windows\SYSTEM32\ntdll.dll]

I’m not an expert in that area, but after looking at the code, it seems you’re having a USplineMeshComponent without a StaticMesh set. At least that is the reason for the failed ensure condition.

#Thank You Martin Z.!

Oh my!

You just made my Christmas that much better!

Thank you for taking the time to reply!

I completely forgot I had been fiddling with a custom spline mesh component in the C++, and I had commented out the code in the constructor, but I forgot to recompile the blueprint in the editor to update it (because the editor compile showed green because it did not detect the change in the c++ constructor)

Thank youuuu!