Results 1 to 2 of 2

Thread: UDK Unreal Script, Stuck Character floating in air

  1. #1
    Join Date
    Aug 2009
    Location
    Burnley
    Posts
    122

    Default UDK Unreal Script, Stuck Character floating in air

    Hello,

    Im having trouble with some UDK unreal Script for a game that im creating, I needed a pawn to follow the player so have got the code set up and running the pawn follows the player but flies he around 2 feet of the ground and i have no way to get him on the floor?

    I have tried everything
    Code:
    Code:
    
    class LoonBot extends GameAIController;//declaring variables here means//they may be used throughout this scriptvar Vector MyTarget;//at the start of the levelsimulated event PostBeginPlay(){super.PostBeginPlay();//start the brain going at half second intervalsSetTimer(0.5, true, 'BrainTimer');}function BrainTimer(){//local variables are only used in this functionlocal Pawn P;local float Distance;//check if theres another pawn, the pawn belongning to this controller isnt countedforeach WorldInfo.AllPawns(class'Pawn', P){if (P != None)  //if there is one{//get the distanceDistance = VSize2D(Pawn.Location - P.Location);//if its closer than 500if (Distance <= 1000)            {             //make its location MyTarget             MyTarget.Y = P.Location.Y;             MyTarget.X = P.Location.X;             //so it doesnt fly up n down             MyTarget.Z = P.Location.Z;             //MoveTo the pawn             GoToState('MoveAbout');            }            else  //if its too far away            {            //do whats in the function called MoveRandom()            MoveRandom();            }          }          else  //if there isnt another pawn          {            //call the function MoveRandom()            aMoveRandom();          }        }}function MoveRandom(){    local int OffsetX;  local int OffsetY;  //make a random number  OffsetX = Rand(500)-Rand(500);  OffsetY = Rand(500)-Rand(500);       //some distance left or right and some distance in front or behind    MyTarget.X = Pawn.Location.X + OffsetX;    MyTarget.Y = Pawn.Location.Y + OffsetY;       //so it doesnt fly up n down       MyTarget.Z = Pawn.Location.Z;    //move to the random location    GoToState('MoveAbout');}state MoveAbout{Begin:    //MoveTo makes it move to a location (vector)    MoveTo(MyTarget);}defaultproperties{}

    I have tried editing the
    Code:
    Code:
    
     MyTarget.Z = P.Location.Z - 47 ; // 47 is the height shown in kismet for my player
    but nothing is working i have tried directly editing it in kismet and still nothing happens
    Here is a picture of my character floating


    Can some one shed some light onto this,
    Thank you
    Attached Images Attached Images

  2. #2
    Join Date
    Aug 2009
    Location
    Burnley
    Posts
    122

    Default

    Problem solved, Collision height needed modding if anyone else has any problems with custom pawns floating

    Code:
    Begin Object Name=CollisionCylinder
    CollisionRadius=?????
    CollisionHeight=?????
    End Object
    CylinderComponent=CollisionCylinder

Similar Threads

  1. team looking for an unreal script developer
    By Uberm4n in forum T2G Developer, General Discussions
    Replies: 0
    Last Post: 12-07-2011, 06:03 PM
  2. Floating point overflow error - Game Maker
    By doghouse in forum Game Maker
    Replies: 17
    Last Post: 05-13-2010, 09:48 AM
  3. Error Script on Course DVD
    By neolewis85 in forum T2G Designer & Production, Technical Discussions
    Replies: 4
    Last Post: 05-09-2010, 11:20 PM
  4. Script problem
    By Mick in forum T2G Designer & Production, Technical Discussions
    Replies: 3
    Last Post: 07-20-2009, 03:33 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •