Dynamically spawned NPC lacks proper collision and gravity behavior

I’m currently making a class that spawns NPCs. The NPCs do spawn correctly at the specified Location and Rotation, but I’m facing issues with their collision and gravity behavior:

  1. Collision Issue: The spawned NPCs don’t seem to have proper collision detection with other objects in the scene. They pass through the player character instead of colliding with them.
  2. Gravity Issue: Additionally, the NPCs don’t fall due to gravity. They remain suspended in mid-air after spawning.

Here’s a snippet of my spawning function for reference:

AALSCharacter* ANPCManager::SpawnNPC(FVector Location, FRotator Rotation)
{
if (NPCBlueprintClass && GetWorld())
{
AALSCharacter* NewNPC = GetWorld()->SpawnActor(NPCBlueprintClass, Location, Rotation);
if (NewNPC)
{
HandleNPCSpawn(NewNPC); // Custom function to handle additional setup
return NewNPC;
}
}
return nullptr;
}

Could someone please advise on why the spawned NPCs don’t have proper collision and why they aren’t affected by gravity? when I manually drag an instance of the NPCBlueprint in the level editor it works perfectly fine. Despite attempting to enable collision in C++ for the mesh, the NPCs still pass through objects and don’t fall. Any insights or suggestions on how to ensure proper collision and gravity behavior for dynamically spawned NPCs would be greatly appreciated. Thanks in advance for your help!

Not sure about the collision issue, would probably have to see more of the setup

But for them not falling, I’m assuming you’re using Characters, and I suspect it’s because the Auto Possess AI is not set to include Spawn as well, so they don’t get possessed, or you have no AI Controller class specified
In the character movement component there is an option called Run Physics With No Controller which is false by default
Without a controller, the movement component will basically not run without this enabled