Hello!
I am a beginner in UE4 and created a project to test my knowledge but I don’t understand , why is my game not the same in the editor and as standalone game.
When I play it in the editor than everything works fine but when I launch the project or run it as a standalone game the Actors (the lifts) moving faster and going higher.
Video ( game in the editor ) - https://streamable.com/6ajhi5
Video ( standalone game ) - https://streamable.com/v2rw0c
ALift::ALift()
{
PrimaryActorTick.bCanEverTick = true;
StaticMesh = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("CustomStaticMesh"));
PlacedLocation = FVector(0.0f);
bShouldFloat = false;
RunningTime = 0.0f;
Speed = 0.0f;
}
void ALift::Tick(float DeltaTime)
{
Super::Tick(DeltaTime);
if (bShouldFloat)
{
PlacedLocation = GetActorLocation();
BaseLocation = PlacedLocation.Z;
FVector NewLocation = GetActorLocation();
NewLocation.Z = BaseLocation + (Speed) * FMath::Sin(RunningTime);
SetActorLocation(NewLocation);
RunningTime += DeltaTime;
}
}