Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class zCrate extends Actor
- HideCategories(Display,Collision,Physics)
- placeable;
- /*----------------------------------------------------------------
- Private vars
- ----------------------------------------------------------------*/
- var SkeletalMeshComponent Mesh;
- var DynamicLightEnvironmentComponent LightEnvironment;
- /*----------------------------------------------------------------
- Methods
- ----------------------------------------------------------------*/
- /**
- * @brief Called at game start
- **/
- simulated function PostBeginPlay()
- {
- Super.PostBeginPlay();
- if(WorldInfo.NetMode == NM_DedicatedServer)
- {
- SetCollision(false, false);
- DetachComponent(Mesh);
- BeginState('IgnoreItAll');
- }
- MaterialInstance = Mesh.CreateAndSetMaterialInstanceConstant(0);
- }
- state IgnoreItAll
- {
- ignores Touch, TakeDamage, Tick;
- }
- /*----------------------------------------------------------------
- Object
- ----------------------------------------------------------------*/
- defaultproperties
- {
- Begin Object class=DynamicLightEnvironmentComponent Name=MyLightEnvironment
- bEnabled=true
- bDynamic=true
- End Object
- Components.Add(MyLightEnvironment)
- LightEnvironment=MyLightEnvironment
- Begin Object class=StaticMeshComponent Name=MyStaticMeshComponent
- StaticMesh=StaticMesh'zGameTest.Mesh.SM_Cube'
- Materials[0]=MaterialInstanceConstant'Gameplay.Material.MI_zCrate'
- LightEnvironment=MyLightEnvironment
- BlockActors=true
- BlockZeroExtent=true
- BlockRigidBody=true
- BlockNonzeroExtent=true
- CollideActors=true
- bUseSingleBodyPhysics=1
- bNotifyRigidBodyCollision=true
- bUseAsOccluder=true
- End Object
- Components.Add(MyStaticMeshComponent)
- Mesh=MySkeletalMeshComponent
- CollisionComponent=MySkeletalMeshComponent
- Physics=PHYS_RigidBody
- bEdShouldSnap=true
- bStatic=false
- bCollideActors=true
- bCollideWorld=true
- bProjTarget=true
- bBlockActors=true
- bPathColliding=true
- }
Add Comment
Please, Sign In to add comment