Hello I've made simple jetpack pickup which thrusts the player into the air lets them fly around for 30 seconds when the fuel runs out and the player falls to the ground. The problem I'm having is that it doesn't always thrust you up the same height It appears to thrust you up the correct height if you walk into the pickup slowly but if you are moving quickly it won't send you very high at all.
Code:
class UTJetPack extends UTInventory
placeable;
var SoundCue ActivateSound;
function GivenTo(Pawn NewOwner, optional bool bDoNotActivate)
{
Super.GivenTo(NewOwner, bDoNotActivate);
WorldInfo.Game.Broadcast(self,"Picked Up JetPack");
SetTimer(30.0, false);
PlaySound(SoundCue'A_Pickups.JetPack_Cue');
NewOwner.Velocity += vect(0,0,1000);
NewOwner.SetPhysics(PHYS_Flying);
Spawn(class'UTJetPackEffect', Owner,, Owner.Location, Owner.Rotation);
}
function Timer()
{
WorldInfo.Game.Broadcast(self,"JetPack Fuel Depleted");
Owner.SetPhysics(PHYS_Falling);
Destroy();
}
defaultproperties
{
Begin Object Class=StaticMeshComponent Name=StaticMeshComponent1
StaticMesh=StaticMesh'Pickups.JetPack'
bOnlyOwnerSee=false
CastShadow=true
bForceDirectLightMap=true
bCastDynamicShadow=false
CollideActors=false
BlockRigidBody=false
Translation=(X=0.0,Y=0.0,Z=-20.0)
Scale=0.2
End Object
DroppedPickupMesh=StaticMeshComponent1
PickupFactoryMesh=StaticMeshComponent1
MaxDesireability=1.00
RespawnTime=30.0
bReceiveOwnerEvents=true
bDropOnDeath=true
PickupSound=SoundCue'A_Pickups_Powerups.PowerUps.A_Powerup_JumpBoots_PickupCue'
ActivateSound=SoundCue'A_Pickups_Powerups.PowerUps.A_Powerup_JumpBoots_JumpCue'
bRenderOverlays=true
}