Announcement

Collapse
No announcement yet.

Pawn is Running.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • replied
    function Tick(float DeltaTime)
    {
    bIsMoving = ( bIsMoving || (VSize(Owner.Velocity) > 10) ) ;
    Super.Tick(DeltaTime);
    }

    || means OR (see logic in maths)
    - if one or more of expressions used in that statment is true, then result is true.
    -When UScript finds one of those expression true it stops searching further and returns true.
    - if all expressions are false, result is false

    now if You set bIsMoving to true it will remain true always, while passing through this code. If you want to make bIsMoving true only if the velocity is greater than 10, you don't need OR here:

    bIsMoving=(VSize(Owner.Velocity) > 10);

    Leave a comment:


  • replied
    try the aforword variable its a float a variable

    something like
    if (aforward != 0)
    do something here

    Leave a comment:


  • replied
    function Tick(float DeltaTime)
    {
    bIsMoving = bIsMoving || (VSize(Owner.Velocity) > 10);
    Super.Tick(DeltaTime);
    }

    is my idea but it's actually a vehicle so I gotta find out what the vehicle deal is but effectivly speaking is my language correct? bIsMoving will be true if the velocity is greater than 10?

    I'm still not 100% sure what the || means...

    Leave a comment:


  • replied
    No wait no wait... lol, ok so I can use PlayMoving to start it but what when it stops moving I see nothing for StopMoving or anything lol help?

    Leave a comment:


  • replied
    Nevermind for those wondering the Pawn class calls function PlayMoving...

    Leave a comment:


  • started a topic Pawn is Running.

    Pawn is Running.

    I want my pawn to do something special when it's running. What variable does it pass down to let the subclasses know the pawn is running? I tried bIsWalking and thats exactly what it says, only when you are holding Shift (by default) and walking. So when the arrow keys (or WASD) are being pressed what is true? I have a function dependant on weither or not the pawn is running...
Working...
X