Hey!
So as mentioned in the title, I wanted to change my MoveSpeed Variable from the BP Details Tab, I changed it and my tank isn’t moving anymore… I put it back to the old speed (203.0f) but I am still having the same problem…
I tried some stuff to figure out what is exactly causing the problem so I did these steps(But none of them helped):
1-I thought maybe it was the Start Delay variable, since the tank was supposed to move if its <= 0(Not sure about that), but when I logged the StartDelay variable out I found out that it wasn’t decreasing(Screenshot Included)
void ATankGameModeBase::BeginPlay()
{
Super::BeginPlay();
GetWorld()->GetTimerManager().SetTimer(TestTimerHandle, this,
&ATankGameModeBase::TestLog, TestRate, true);
HandleGameStart();
}
void ATankGameModeBase::TestLog()
{
UE_LOG(LogTemp, Error, TEXT("Start delay: %d"),StartDelay);
}
2-I also thought the MoveSpeed float variable isn’t working or something, so I tried changing it’s name from MoveSpeed to Movement Speed and recompiled the project but still didn’t work.
The CalculateMoveInput function:
void APawnTank::CalculateMoveInput(float Value)
{
float MoveAmount = (Value * MovementSpeed * GetWorld()->DeltaTimeSeconds);
MoveDirection = FVector(MoveAmount, 0, 0);
}
3-Tried changing the MovementSpeed variable manually from the source code.
UPROPERTY(EditInstanceOnly, BlueprintReadOnly, Category = "Components", meta = (AllowPrivateAccess = "true"))
float MovementSpeed = 300.0f;