Just beginning with c++. I am trying to make MovementMagnitude to be editable in the UEditor but something is not right.
This is the header
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = MovementMagnitude)
float MovementMagnitude;
float RunningTime;
This is the c++ file
// Called every frame
void AFloatingActor::Tick( float DeltaTime )
{
Super::Tick( DeltaTime );
FVector NewLocation = GetActorLocation();
float DeltaHeight = (FMath::Sin(RunningTime + DeltaTime) - FMath::Sin(RunningTime));
NewLocation.Z += DeltaHeight * MovementMagnitude;
RunningTime += DeltaTime;
SetActorLocation(NewLocation);
}
MovementMagnitude is set to the value from the editor but NewLocation vector gets a strange value: X=0.000000000 Y=0.000000000 Z=-1.79213164e-014.