Commit 6b7c07a1 authored by Ridel Morgan's avatar Ridel Morgan
Browse files

update

parent f4eaaf93
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
// Fill out your copyright notice in the Description page of Project Settings.
#include "TankTrack.h"
void UTankTrack::SetThrottle(float Throttle) {
FString Name = GetName();
UE_LOG(LogTemp, Warning, TEXT("%s throttle value: %f"), *Name, Throttle);
auto ForceAplied = GetForwardVector() * Throttle * TrackMaxDrivingForce;
auto ForceLocation = GetComponentLocation();
auto TankRoot = Cast<UPrimitiveComponent>(GetOwner()->GetRootComponent());
TankRoot->AddForceAtLocation(ForceAplied, ForceLocation);
}
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "Components/StaticMeshComponent.h"
#include "TankTrack.generated.h"
/**
*
*/
UCLASS(ClassGroup = (Custom), meta = (BlueprintSpawnableComponent))
class BATTLETANKS_API UTankTrack : public UStaticMeshComponent
{
GENERATED_BODY()
public:
UFUNCTION(BlueprintCallable, Category = Input)
void SetThrottle(float Throttle);
UPROPERTY(EditDefaultsOnly)
float TrackMaxDrivingForce = 20000000;
};
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment