| Home Page | Recent Changes | Preferences

Trystan/12 26 02

HOWTO: Modify Player Speed

You can either subclass xPawn or you can create a mutator.

Subclassing xPlayer

The following is simple UnrealScript version of an extended xPawn that modifies the speeds of the player in various ways.

class MyPawn extends xPawn;

defaultproperties
{
    GroundSpeed         =   350.000000      // 220
    WaterSpeed          =   210.000000      // 110
    AirSpeed            =   320.000000      // 220
    JumpZ               =   210.000000      // 170
    AccelRate           =   1024            // half normal
    WalkingPct          =   0.60000         // walking = walkspeed * this
    CrouchedPct         =   0.45000         // crouched moving = walkspeed * this
    MaxFallSpeed        =   665             // speed needed to reach before falling damage

    MultiJumpRemaining  =   0
    MaxMultiJump        =   0
    MultiJumpBoost      =   0
    bCanDoubleJump      =   False
}

Mutator

Create a simple mutator and in ModifyPlayer add in code to change the above variables, i.e.:

function ModifyPlayer( Other )
{
     Other.default.GroundSpeed =     350.000000;
     Other.default.WaterSpeed  =     210.000000;
     Other.default.AirSpeed    =     320.000000;
}

The Unreal Engine Documentation Site

Wiki Community

Topic Categories

Image Uploads

Random Page

Recent Changes

Offline Wiki

Unreal Engine

Console Commands

Terminology

Mapping Topics

Mapping Lessons

UnrealEd Interface

Questions&Answers

Scripting Topics

Scripting Lessons

Making Mods

Class Tree

Questions&Answers

Modeling Topics

Questions&Answers

Log In