Hallo! I have tried many methods trying to make my custom collision work. Only standart cyllinder collision works fine, but its not enough.
I have created simple mesh in 3ds max, added collision there using MCDCX_ prefix, and it collides absolutly fine with other actors and same meshes if I add this mesh to level in Editor. But, when I spawn two actors using unrealscript, both have this mesh by default -> they flying through each other but collide with level geometry and even with same meshes added in Editor. One is not moving at all, and second moved by MoveSmooth in Tick, not SetLocation =)
Before and after (both are spawned, green moves through red):

Code that spawns actor to level:
And next is spawned "Overlay" actor's code
So... whats wrong with it?
thanks!
I have created simple mesh in 3ds max, added collision there using MCDCX_ prefix, and it collides absolutly fine with other actors and same meshes if I add this mesh to level in Editor. But, when I spawn two actors using unrealscript, both have this mesh by default -> they flying through each other but collide with level geometry and even with same meshes added in Editor. One is not moving at all, and second moved by MoveSmooth in Tick, not SetLocation =)
Before and after (both are spawned, green moves through red):


Code that spawns actor to level:
Code:
class CreateOverlay extends Actor
placeable;
var Overlay OVL;
var vector Offset;
function AddOverlay()
{
local rotator SpawnRotation;
SetRandomLocation();
SpawnRotation.Yaw = SetRandomRotation();
OVL = spawn( class'Overlay', self,, ( Location + Offset ), SpawnRotation )
}
function SetRandomLocation()
{
Offset.X = 100 * Rand(5);
Offset.Y = 100 * Rand(5);
}
function int SetRandomRotation()
{
return Rand(4) * 16384;
}
DefaultProperties
{
Offset=(X= 0, Y=0, Z=-100)
Begin Object Class=SpriteComponent Name=CrOvSprite
Sprite=Texture2D'EditorResources.S_NavP'
HiddenGame=True
End Object
Components.Add(CrOvSprite)
}
Code:
class Overlay extends Actor placeable; var vector OVLVelocity; auto state Move { function Tick ( float DeltaTime ) { MoveSmooth ( OVLVelocity * 10 * DeltaTime); } } DefaultProperties { OVLVelocity=(X=100, Y=100, Z=0) bCollideActors=true bBlockActors=true bCollideWorld=true Begin Object Class=DynamicLightEnvironmentComponent Name=MyLightEnvironment bEnabled=TRUE End Object Components.Add(MyLightEnvironment2) Begin Object Class=StaticMeshComponent Name=MeshOverlay StaticMesh=StaticMesh'Kdavraty.Mesh.complex_IL' Materials(0)=Material'EditorMaterials.WidgetMaterial_Y' LightEnvironment=MyLightEnvironment Scale3D=(X=2,Y=2,Z=2) CastShadow = false End Object CollisionComponent=MeshOverlay Components.Add(MeshOverlay) //MeshOverlay.SetActorCollision(true, true) <- found this somewhere, not workin, causes warning by compilation }
thanks!
Comment