Hello, so I’m trying to make an enemy actor move to a random location in the world
in Tick I have this:
NewLocation.X = FMath::FRandRange(0, 0);
NewLocation.Y = FMath::FInterpTo(GetActorLocation().Y, FMath::FRandRange(73.4, 3345.2), DeltaTime, 2);
NewLocation.Z = FMath::FInterpTo(GetActorLocation().Z, FMath::FRandRange(1195.2, -1503.4), DeltaTime, 2);
if (IsMoving == false)
{
IsMoving = true;
SetActorLocation(NewLocation);
}
and I have a function that gets called every X seconds which makes the IsMoving true
now if I do it without the timer then it just keeps jumping to locations really fast
does anyone know how I can fix this? or maybe my code is working but the random locations being selected are too close and if it’s that is there any way to fix it?
Video demonstration: