Rotation start
This commit is contained in:
@@ -51,8 +51,8 @@ private:
|
||||
USceneComponent* ProjectileSpawnPoint;
|
||||
|
||||
//test uprops showing all that you can do with them
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Super Duper Variables", meta = (AllowPrivateAccess = "true"))
|
||||
float Speed = 400.f;
|
||||
/*UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Super Duper Variables", meta = (AllowPrivateAccess = "true"))
|
||||
float Speed = 400.f;*/
|
||||
|
||||
UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Super Duper Variables", meta = (AllowPrivateAccess = "true"))
|
||||
int32 VisibleAnywhere = 12;
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#include "Tank.h"
|
||||
#include "GameFramework/SpringArmComponent.h"
|
||||
#include "Camera/CameraComponent.h"
|
||||
#include "Kismet/GameplayStatics.h"
|
||||
#include "Components/InputComponent.h"
|
||||
|
||||
ATank::ATank()
|
||||
@@ -32,8 +33,9 @@ void ATank::Move(float Value)
|
||||
{
|
||||
//FVector DeltaLocation(0.f); //Same as line below
|
||||
FVector DeltaLocation = FVector::ZeroVector;
|
||||
DeltaLocation.X = Value;
|
||||
AddActorLocalOffset(DeltaLocation);
|
||||
// X = Value * DeltaTime * Speed
|
||||
DeltaLocation.X = Value * Speed * UGameplayStatics::GetWorldDeltaSeconds(this);
|
||||
AddActorLocalOffset(DeltaLocation, true);
|
||||
//UE_LOG(LogTemp, Warning, TEXT("Value: %f"), Value);
|
||||
}
|
||||
|
||||
|
||||
@@ -27,6 +27,10 @@ private:
|
||||
UPROPERTY(VisibleAnywhere, Category = "Components")
|
||||
class UCameraComponent* Camera;
|
||||
|
||||
void Move(float Value);
|
||||
UPROPERTY(EditAnywhere, Category = "Movement")
|
||||
float Speed = 200.f;
|
||||
|
||||
void Move(float Value);
|
||||
|
||||
void Turn(float TValue);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user