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...
Announcement
Collapse
No announcement yet.
Pawn is Running.
Collapse
X
-
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...
Comment
-
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);
Comment
Comment