I have a custom class extended from KActorSpawnable that handles spawning actors of various shapes at runtime. Each actor looks something like a Tetris block (made up of StaticMeshComponents, each of which is a cube, and each of which is also spawned at runtime). Since I plan to have many such actors with many different shapes, the system needs to be coded dynamically like this.
My problem is, only the original StaticMeshComponent (the one defined in DynamicSMActor) receives rigid body collision. All the other dynamically spawned components act with no collision and pass through walls, the player, etc. What I want is to have each component have rigid body collision, so that the entire block behaves like a single unified rigid body shape.
My dynamic spawning code:
What am I doing wrong? And is this even possible?
simulated event PostBeginPlay()
local int i;
local StaticMeshComponent SMC;
local LightingChannelContainer LCC;
LCC.Dynamic = true;
for(i = 0; i < Blocks.Length; i++)
SMC = new class'StaticMeshComponent';
SMC.SetTranslation(64 * Blocks[i]);
// RIGID BODY
SMC.ScriptRigidBodyCollisionThreshold = 0.001;