| Home Page | Recent Changes | Preferences

Vehicles/Exiting

Exiting while SubMerged

When you drive/fly/float your vehicle under water, and you get out, you can't move anymore, this is because your Physics is set to Falling, but it has to be Swimming. This can be fixed easy:

function bool KDriverLeave(bool bForceLeave)
{
    local Pawn OldDriver;

    OldDriver = Driver;

    // If we successfully got out of the car, make driver visible again. And check if in water.
    if( Super.KDriverLeave(bForceLeave) )
    {
        OldDriver.bHidden = false; //Also seen in the bulldog, so can't be bad :)
        //If we are in water, set the physics to swimming
        if (OldDriver.TouchingWaterVolume())
        {
            OldDriver.SetPhysics(PHYS_Swimming);
        }
        return true;
    }
    else
        return false;
}

The Unreal Engine Documentation Site

Wiki Community

Topic Categories

Image Uploads

Random Page

Recent Changes

Offline Wiki

Unreal Engine

Console Commands

Terminology

FAQs

Help Desk

Mapping Topics

Mapping Lessons

UnrealEd Interface

UnrealScript Topics

UnrealScript Lessons

Making Mods

Class Tree

Modeling Topics

Chongqing Page

Log In