Rotation start

This commit is contained in:
2025-07-20 01:15:34 -04:00
parent 6a57c74661
commit aee1f481cb
6 changed files with 15 additions and 9 deletions

View File

@@ -87,10 +87,10 @@ DefaultViewportMouseLockMode=LockOnCapture
FOVScale=0.011110
DoubleClickTime=0.200000
+ActionMappings=(ActionName="Fire",bShift=False,bCtrl=False,bAlt=False,bCmd=False,Key=LeftMouseButton)
+AxisMappings=(AxisName="MoveForward",Scale=4.000000,Key=W)
+AxisMappings=(AxisName="MoveForward",Scale=-4.000000,Key=S)
+AxisMappings=(AxisName="Turn",Scale=4.000000,Key=D)
+AxisMappings=(AxisName="Turn",Scale=-4.000000,Key=A)
+AxisMappings=(AxisName="MoveForward",Scale=1.000000,Key=W)
+AxisMappings=(AxisName="MoveForward",Scale=-1.000000,Key=S)
+AxisMappings=(AxisName="Turn",Scale=1.000000,Key=D)
+AxisMappings=(AxisName="Turn",Scale=-1.000000,Key=A)
+AxisMappings=(AxisName="RotateTurret",Scale=1.000000,Key=MouseX)
DefaultPlayerInputClass=/Script/EnhancedInput.EnhancedPlayerInput
DefaultInputComponentClass=/Script/EnhancedInput.EnhancedInputComponent

Binary file not shown.

View File

@@ -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;

View File

@@ -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);
}

View File

@@ -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);
};