I have my custom character in and the animation are working but I am having problems with the fact that the character has no health. The HUD is there but the health is at zero, and of course the character has not died. Below is my code.
Also when I type in behind view nothing happens as if the character is not being recognised. The logs has not shown up any errors. Also when i point the camera at any surface it pops back displaying the character floating some distance away. Any help would be appreciated.Code:class CustomPawn extends UDKPawn; var int RegenPerSecond; var float ElapsedTime; var float DamageTime; simulated event PostBeginPlay() { super.PostBeginPlay(); //print to show code is working `Log("USING CUSTOM PAWN CALLED CustomPawn."); //set the timer for 1 second SetTimer(1.0,true); } function Timer () { //if the pawn is in the water regenerate health if(PhysicsVolume.bRegenVolume == true) { if (Controller.IsA('PlayerController') && !IsInPain() && Health<HealthMax) { Health = Min(Health+RegenPerSecond, HealthMax); } } } DefaultProperties { //breathing time UnderWaterTime=+00000.000000 //set the variables RegenPerSecond = 2 //set defaults for regeneration properties DamageTime=1 Begin Object class=SkeletalMeshComponent Name=PlayerSkeletalMeshComponent assigning mesh to environment //LightEnvironment=MyLightEnvironment CastShadow=true bCastDynamicShadow=true bOwnerNoSee=false bHasPhysicsAssetInstance=true bEnableSoftBodySimulation=true bSoftBodyAwakeonStartup=True PhysicsAsset=PhysicsAsset'NeasaRonayneAssets.SadbhCharacter.Sadbh_Physics' SkeletalMesh=SkeletalMesh'NeasaRonayneAssets.SadbhCharacter.Sadbh' AnimSets(0)=AnimSet'NeasaRonayneAssets.SadbhCharacter.aT_walking' AnimSets(1)=AnimSet'NeasaRonayneAssets.SadbhCharacter.aT_strafeR' AnimSets(2)=AnimSet'NeasaRonayneAssets.SadbhCharacter.aT_strafeL' AnimSets(3)=AnimSet'NeasaRonayneAssets.SadbhCharacter.aT_idle' AnimSets(4)=AnimSet'NeasaRonayneAssets.SadbhCharacter.aT_bending' AnimSets(5)=AnimSet'NeasaRonayneAssets.SadbhCharacter.aT_backwards' AnimTreeTemplate=AnimTree'NeasaRonayneAssets.SadbhCharacter.SadbhAnim' HiddenGame=false HiddenEditor=false End Object Mesh=PlayerSkeletalMeshComponent Components.Add(PlayerSkeletalMeshComponent) }



Reply With Quote

Bookmarks