I'm trying to make a my PlayerPawn move a fixed distance on the X axis but I'm having some trouble getting this value to be a little precise...
I tried using the Tick function in the Pawn to check if the distance were reached already but it never moved the same distance before stopping...
Any ideias how to do this? Matinee maybe? I'm running out of ideas...
but analysing the results from the `log(Abs(dashStartPos.X - Location.X)); my pawn wasnt moving DashDistance... it was moving anything above DashDistance. I couldn't get anything more precise than this. ; (
I tried using the Tick function in the Pawn to check if the distance were reached already but it never moved the same distance before stopping...
Any ideias how to do this? Matinee maybe? I'm running out of ideas...
Code:
function bool DashStart(vector Dir)
{
dashStartPos = Location;
bDashing = true;
Velocity = DashSpeed*Dir;
return true;
}
Code:
simulated function Tick(float DeltaTime)
{
super.Tick(DeltaTime);
if(bDashing)
{
if(Abs(dashStartPos.X - Location.X) >= DashDistance) {
bDashing= false;
Velocity.X = 0;
`log(Abs(dashStartPos.X - Location.X));
}
}
}
but analysing the results from the `log(Abs(dashStartPos.X - Location.X)); my pawn wasnt moving DashDistance... it was moving anything above DashDistance. I couldn't get anything more precise than this. ; (
Last edited: