Just messing around with some things in unreal since I’m new to it but I have some very simple code that spawns a static mesh actor into the world when the user presses a button. That spawned actor does not seem to have any collision even though it should and I can’t figure out what I’m missing.
AStaticMeshActor* foundation = GetWorld()->SpawnActor<AStaticMeshActor>(SpawnLocation, FRotator::ZeroRotator);
foundation->GetStaticMeshComponent()->StaticMesh = BuildingFoundation;
foundation->GetStaticMeshComponent()->SetEnableGravity(false);
Where “BuildingFoundation” is just the “Floor_400x400” Static Mesh from the Starter Content.
If I place the “Floor_400x400” into the editor before run time, the collision seems to work fine on that actor. After spawning it into the world at run time, there is no collision on it. If I toggle a random physics/collision property on the spawned actor during run time in the editor, only then does collision seem to start working. Not sure if this is a bug or if I’m just missing some kind of “enable collision right away” method or property on the static mesh actor but any help would be appreciated.