Hey guys,
I have a pawn which has a couple of sockets in its mesh which i have attached a set of kactorspawnalbes too. The Idea is when you shoot the kactor it falls of the pawn, this part works. However what im am having an issues is that after the kactor has detached from the pawn i can't push it with my pawn like i would a normal kactor i place in editor. Ive been trolling the net looking for awnsers but all i can seem to find is "i've solved it thanks guys!", never an explanation
.
I'm using the same static mesh as i do for my kactors in the editor and i can push them around no problem.
I have set a physics scale.
I have set a collision on the mesh in the editor.
Pushing Pawn Code
Pawn with actors attached CodeCode:bPushesRigidBodies=true RBPushStrength = 200.0;
Code:class StationaryPawn extends UTPawn placeable; var TurretController MyController; var float Speed; var SkeletalMeshComponent MyMesh; var bool bplayed; var Name AnimSetName; var AnimNodeSequence MyAnimPlayControl; var () float attackrange; var () float perceptionDistance; var () float hearingDistance; var Syn_ModularPawn_Spike Spike1,Spike2,Spike3,Spike4; var Synergy2_MovableObject Sphere; var Vector SocketLocation; var Rotator SocketRotation; defaultproperties { Begin Object Class=SkeletalMeshComponent Name=InitialSkeletalMesh CastShadow=true bCastDynamicShadow=true bOwnerNoSee=false LightEnvironment=MyLightEnvironment; BlockRigidBody=true; CollideActors=true; BlockZeroExtent=true; HiddenGame=true; SkeletalMesh=SkeletalMesh'SynergyTest.SkeletalMesh.Test' End Object Mesh=InitialSkeletalMesh; Components.Add(InitialSkeletalMesh); } function TurretController GetController(){ return MyController; } simulated function PostBeginPlay() { if (Mesh != None) { if (Mesh.GetSocketByName('Right Arm') != None) { Mesh.GetSocketWorldLocationAndRotation('Right Arm', SocketLocation, SocketRotation); Spike1 = Spawn(class'Syn_ModularPawn_Spike',,, SocketLocation, SocketRotation); if (Spike1 != None) { Spike1.SetBase(self,, Mesh, 'Right Arm'); Spike1.ForceNetRelevant(); Spike1.bNetDirty = true; } } if (Mesh.GetSocketByName('Left Arm') != None) { Mesh.GetSocketWorldLocationAndRotation('Left Arm', SocketLocation, SocketRotation); Spike2 = Spawn(class'Syn_ModularPawn_Spike',,, SocketLocation, SocketRotation); if (Spike2 != None) { Spike2.SetBase(self,, Mesh, 'Left Arm'); Spike2.ForceNetRelevant(); Spike2.bNetDirty = true; } } if (Mesh.GetSocketByName('FrontArm') != None) { Mesh.GetSocketWorldLocationAndRotation('FrontArm', SocketLocation, SocketRotation); Spike3 = Spawn(class'Syn_ModularPawn_Spike',,, SocketLocation, SocketRotation); if (Spike3 != None) { Spike3.SetBase(self,, Mesh, 'FrontArm'); Spike3.ForceNetRelevant(); Spike3.bNetDirty = true; } } if (Mesh.GetSocketByName('BackArm') != None) { Mesh.GetSocketWorldLocationAndRotation('BackArm', SocketLocation, SocketRotation); Spike4 = Spawn(class'Syn_ModularPawn_Spike',,, SocketLocation, SocketRotation); if (Spike4 != None) { Spike4.SetBase(self,, Mesh, 'BackArm'); Spike4.ForceNetRelevant(); Spike4.bNetDirty = true; } } if (Mesh.GetSocketByName('Middle') != None) { Mesh.GetSocketWorldLocationAndRotation('Middle', SocketLocation, SocketRotation); Sphere = Spawn(class'Synergy2_MovableObject',,, SocketLocation, SocketRotation); if (Sphere != None) { Sphere.SetBase(self,, Mesh, 'Middle'); Sphere.ForceNetRelevant(); Sphere.bNetDirty = true; } } } super.PostBeginPlay(); SetPhysics(PHYS_Walking); if (MyController == none) { MyController = Spawn(class'TurretController', self); MyController.SetPawn(self); } }
KactorSpawnable Code
Any Ideas Would be WikidCode:class Syn_ModularPawn_Spike extends KActorSpawnable; var Float Hp; var int d; Simulated Event TakeDamage(int DamageAmount, Controller EventInstigator, vector HitLocation, vector Momentum, class<DamageType> DamageType, optional TraceHitInfo HitInfo, optional Actor DamageCauser) { Super.TakeDamage(DamageAmount,EventInstigator,HitLocation,Momentum,DamageType,HitInfo,DamageCauser); Hp = Hp-DamageAmount; `log(Hp); if(Hp < 0 ) { self.SetBase(none); self.SetPhysics(PHYS_Falling); self.SetPhysics(PHYS_RigidBody); } } defaultproperties { bMovable = true; bCanStepUpOn = false bProjTarget=true bCollideActors=true bCollideWorld=true bHardAttach=true Hp = 10; Begin Object Class=StaticMeshComponent Name=RollerSpike StaticMesh=StaticMesh'SynergyTest.RollerSpike' bNotifyRigidBodyCollision=true HiddenGame=FALSE ScriptRigidBodyCollisionThreshold=0.001 LightingChannels=(Dynamic=TRUE) BlockRigidBody=true RBChannel=RBCC_GameplayPhysics RBCollideWithChannels=(Default=TRUE,BlockingVolume=TRUE,GameplayPhysics=TRUE,EffectPhysics=TRUE) bCollideActors = true bCollideWorld = true bBlockActors = true End Object CollisionComponent=RollerSpike Components.Add(RollerSpike) bDamageAppliesImpulse = false; }![]()



!", never an explanation
.
Reply With Quote

Bookmarks