This is the ReadMe of my TopDownRTSTemplate V2.0.0 and later, a Plugin which is available in Unreal-Marketplace.
Gameplay 1: https://www.youtube.com/watch?v=d6FlkAB78Sc
Gameplay 2: https://www.youtube.com/watch?v=eEvKYroF2Qg
Pathfinding: https://www.youtube.com/watch?v=QqpaFlBx1KQ
https://www.unrealengine.com/marketplace/en-US/product/5653ae7bd50e4c52a2ed962ab01e1717
If you have downloaded the plugin it can be found in your Unreal Engine folder:
C:\Program Files\Epic Games\UE_5.0\Engine\Plugins\TopDownRTSTemplate (for example)
If you can find this folder in your enginge plugins folder the download was successful.
If the plugin is in another folder, you should copy it here.
Open Unreal Editor. Click Edit -> Plugins to open the plugin window.
Search for TopDownRTSTemplate and put a check mark at it.
RTSUnitTemplate/Document/Description_Backup_2022-11-14_102425_RTSUnitTemplate.ini
RTSUnitTemplate/Document/Gameplay_Debugger_Backup_2022-11-14_102535_RTSUnitTemplate.ini
RTSUnitTemplate/Document/Input_Backup_2022-11-14_102458_RTSUnitTemplate.ini (Deprecated, use Enhanced Keyboard Settings)
RTSUnitTemplate/Document/Maps_&_Modes_Backup_2022-11-14_102333_RTSUnitTemplate.ini
You can download these files also from github (https://github.com/SilvanTeufel/Unreal_Plugin_Configs) by clicking on top left Code->Download Zip
For using Enhanced Keyboard Settings the Plugin (Enhanced Input) has to be activated as well (from Unreal Engine).
You can Change Inputs at: All\Engine\Plugins\TopDownRTSCamLib\Content\Blueprints\Controls
For GameplayTags you have to set AssetMangerClass in ProjectSettings (Restart Project after change):
Go to ProjectSettings->Input and set EnhancedIputComponentBase:
YOu can set MappingContext and ControlAsset in the BP_CameraBase:
You can also Download the Settings here from Github.
Weapon will be Attached to Socket in Skeleton, please Name the Socket:
You can also add a Preview Asset and Rotate/Move the Weapon according to its best Position.
Check the WeaponTable in Blueprints/Actors/WeaponTable
Open Unreal Editor. Open folder (In Unreal Editor folder tab):
All\Engine\Plugins\TopDownRTSTemplate\Content\TopDownRTSTemplate\Level\levelOne
Open Unreal Editor. Open folder (In Unreal Editor folder tab):
All\Engine\Plugins\TopDownRTSTemplate\Content\TopDownRTSTemplateLevel\levelTwo
Your can find example Blueprints in the Unreal Editor as well:
All\Engine\Plugins\TopDownRTSTemplate\Content\TopDownRTSTemplate\Blueprints
This Blueprints use the Parent Classes from TopDownRTSTemplate Plugin, which you can use for your Blueprints.
If TopDownRTSTemplate is installed the Classes can be used as Parent Class in Blueprint, so all functions from this Class are available.
Just use one of the following Classes as Parent Class and or just choose them in your GameMode Blueprint. Category = TopDownRTSTemplate.
Parentclasses are:
Actors:
Animations:
Characters:
Controller:
GameMode:
Hud:
Widgets:
For ControllerBase, if you want to use the Controller, you have to adapt your Settings (Pictures in "Document/Inputs" Folder), or "Import Keyboard Settings" (topic above).
Here is a List of the Classes and there Functions:
(All Variables and Functions are accessible via Blueprint - BlueprintReadWrite or EditAnywhere (so editable in Details Panel) or Both.)
BP_UnitBase Setup
BP_UnitBaseController
Character Animation Statemachine
HUD/Actor Setup
Widget Setup
A derived class based on the APathSeekerBase
class.
IsFriendly
(bool): Whether the unit is friendly or not. Editable in Blueprint.IsFlying
(bool): Whether the unit is flying or not. Editable in Blueprint.FlyHeight
(float): The height at which the unit can fly. Editable in Blueprint.Range
(float): The range within which the unit can attack. Editable in Blueprint.StopChaseAtDistance
(float): The distance at which the unit should stop chasing its target. Editable in Blueprint.MaxRunSpeed
(float): The maximum speed of the unit when running. Editable in Blueprint.IsAttackedSpeed
(float): The speed of the unit when it is attacked. Editable in Blueprint.RunSpeedScale
(float): The factor by which the unit's speed is scaled when running. Editable in Blueprint.StopRunTolerance
(float): The tolerance value for the unit's stopping distance when running. Editable in Blueprint.StopRunToleranceY
(float): The tolerance value for the unit's stopping distance on the Y-axis when running. Editable in Blueprint.StopRunToleranceForFlying
(float): The tolerance value for the unit's stopping distance when flying. Editable in Blueprint.UnitControlTimer
(float): A timer used in the UnitControllerBase
state machine. Editable in Blueprint.AttackDamage
(float): The damage the unit can inflict on its target. Editable in Blueprint.AttackDuration
(float): The duration of the attack animation. Editable in Blueprint.PauseDuration
(float): The duration of the pause state in the state machine. Editable in Blueprint.ToggleUnitDetection
(bool): Whether the unit can detect other units or not. Editable in Blueprint.UnitToChase
(AUnitBase*): A pointer to the unit that the current unit is chasing. Editable in Blueprint.UnitsToChase
(TArray<AUnitBase*>): An array of units that the current unit can chase. Editable in Blueprint.AUnitBase(const FObjectInitializer& ObjectInitializer)
: Constructor for the AUnitBase
class.virtual void BeginPlay() override
: Called when the game starts or when spawned.virtual void Tick(float DeltaTime) override
: Called every frame.virtual void SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) override
: Called to bind functionality to input.void IsAttacked(AActor* AttackingCharacter)
: Sets the unit's movement speed when it is attacked.void SetWalkSpeed(float Speed)
: Sets the unit's walking speed.void SetNextUnitToChase(AUnitBase* NewUnit)
: Sets the next unit for the current unit to chase.void StopChase()
: Stops the unit from chasing any target.void StartAttack()
: Starts the attack animation for the unit.void StopAttack()
: Stops the attack animation for the unit.void Pause()
: Sets the unit's state to Pause.void MoveTo(const FVector& Location)
: Sets the unit's destination for movement.void MoveToActor(AActor* Actor)
: Sets the unit's destination to an actor's location.void Attack(AUnitBase* Target)
: Initiates an attack on a target unit.void AttackActor(AActor* TargetActor)
: Initiates an attack on a target actor.void AttackEnd()
: Called at the end of the attack animation.void AttackHit()
: Called when the unit's attack hits its target.void AttackMiss()
: Called when the unit's attack misses its target.void DestroyUnit()
: Destroys the unit and removes it from the game.void SetUnitData(const FUnitData& Data)
: Sets the unit's data.void OnTargetSensed(AActor* Actor, FAIStimulus Stimulus)
: Called when the unit senses a target.void OnTargetLost(AActor* Actor, FAIStimulus Stimulus)
: Called when the unit loses sight of a target.void IsAttacked(AActor* AttackingCharacter)
: Sets the unit's movement speed when it is attacked.void SetWalkSpeed(float Speed)
: Sets the unit's walking speed.void AttackEnd()
: Called at the end of the attack animation.void AttackHit()
: Called when the unit's attack hits its target.void AttackMiss()
: Called when the unit's attack misses its target.void Pause()
: Sets the unit's state to Pause.void StartAttack()
: Starts the attack animation for the unit.void StopAttack()
: Stops the attack animation for the unit.Properties (EditAnyWhere + BlueprintReadWrite) | Note |
---|---|
float TeleportStartTime = 1.f; | Time Spent in UnitState TeleportStart |
float TeleportEndTime = 0.5f; | Time Spent in UnitState TeleportEnd |
float TeleportRadius = 70.f; | Radius which is allowed to Teleport |
float TeleportFailedDmg = 10.f; | Dmg recived when Teleporting out of Radius |
float TeleportManaCost = 30.f; | Mana Cost when using Teleport |
TSubclassOf |
Choose BP_WeaponBase Class (And add Weapontable in BP_WeaponBase) |
TSubclassOf |
Choose BP_ScatterMine Class (which has also Details to change) |
TSubclassOf |
Choose BP_Shield Class (which has also Details to change) |
TSubclassOf |
Choose BP_MouseBotBase Class (which has also Details to change) |
float MouseBotCastTime = 0.4f; | Time Spent in UnitState PrepareMouseBot |
float MouseBotRadius = 15.f; | Radius where the MouseBot can be spawned |
float BotManaCost = 5.f; | Mana Cost to Spawn a Mousebot |
class UWidgetComponent* HealthWidgetComp; | Choose the WidgetComp for the HealthBar (BP_UnitBaseHealthBar) |
float MaxMana = 100.f; | Max Mana of the Character |
float ManaRestore = 1.f; | This amount gets Restored each Time ManaRestoreTime is reached |
float ManaRestoreTime = 1.f; | ManaRestore gets added to Mana when ManaRestoreTime is reached |
float NoManaTime = 1.5f; | Time Spent in UnitState NoMana |
Properties (BlueprintReadWrite) | Note |
---|---|
class AWeaponBase* Weapon; | The Pointer to the Weapon |
TArray |
Weapon Names gets stored in an Array |
TArray |
Comes from DataTable |
TArray |
Current Magazine Size |
int ActualWeaponId = 1; | Actual Weapon Id is stored here |
UMaterialInterface* ProjectileMaterial; | Comes from DataTable |
UStaticMesh* ProjectileMesh; | Comes from DataTable |
FVector TeleportLocation; | Current Location where to Teleport - comes from ControllerBase |
Functions (BlueprintCallable) | Note |
---|---|
void WeaponSpawn(); | Spawns the Weapon |
void ChangeWeapon(FString WeaponName); | Change the Weapon |
void Fire(); | Plays the Fire Animation of the Weapon |
class USkeletalMesh* GetWeaponMesh(); | Gets the WeaponMesh from WeaponTable |
void ReloadWeapon(); | Reload the Weapon |
Properties (EditAnyWhere + BlueprintReadWrite) | Note |
---|---|
float Margin = 15; | Margin the ScreenSize where Camera-Mouse-Movement gets toggled |
int GetViewPortScreenSizesState = 1; | Choose 1 or 2 to set SetViewPortScreenSizes 2 uses GSystemResolution |
float CamSpeed = 80; | Choose the Speed of the Camera |
float ZoomOutPosition = 20000.f; | The Position the Camera should stop when Zooming out fast (Press Space) |
float ZoomPosition = 1500.f; | The Position where Camera should stop when Zooming in again (Standard Position) |
class UWidgetComponent* ControlWidgetComp; | Used when Tab gets pressed to show Control Shortcuts |
FRotator ControlWidgetRotation = FRotator(50, 180, 0); | Change the Rotation of the Control-Widget |
FVector ControlWidgetLocation = FVector(400.f, -100.0f, -250.0f); | Change the Location of the Control-Widget |
FVector ControlWidgetHideLocation = FVector(400.f, -2500.0f, -250.0f); | Change the Location of the Control-Widget if it is hidden |
Properties (BlueprintReadWrite) | Note |
---|---|
USceneComponent* RootScene; | Pointer to the RootScene |
USpringArmComponent* SpringArm; | Pointer to the SpringArm |
Rotator SpringArmRotator = FRotator(-50, 0, 0); | Rotation of the SpringArm |
UCameraComponent* CameraComp; | Pointer to the CameraComp |
APlayerController* PC; | Pointer to the PlayerController |
int32 ScreenSizeX; | This is set by SetViewPortScreenSizes |
int32 ScreenSizeY; | This is set by SetViewPortScreenSizes |
float PitchValue = 0.f; | Used for Rolling Cam |
float YawValue = 0.f; | Used for Rolling Cam |
float RollValue = 0.f; | Used for Rolling Cam |
bool RollCamRight = false; | Is set to Roll Cam in Tick |
bool RollCamLeft = false; | Is set to Roll Cam in Tick |
bool ZoomCamOut = false; | Is set to Zoom Cam in Tick |
bool ZoomCamIn = false; | Is set to Zoom Cam in Tick |
bool ZoomCamOutToPosition = false; | Is set to Zoom Cam to ZoomOutPosition in Tick |
bool MoveCamForward = false; | Is set to Move Cam in Tick |
bool MoveCamBackward = false; | Is set to Move Cam in Tick |
bool MoveCamLeft = false; | Is set to Move Cam in Tick |
bool MoveCamRight = false; | Is set to Move Cam in Tick |
int CamAngle = 0; | Current Cam Angle |
Functions (BlueprintCallable) | Note |
---|---|
void CreateCameraComp(); | Is Creating the Camera |
void SetViewPortScreenSizes(int x); | Sets ScreenSize X/> |
void SpawnControllWidget(); | Spawns the Control Widget |
FVector GetCameraPanDirection(); | Used in Tick to get Pandirection |
void PanMoveCamera(const FVector& PanDirection); | Move Camera via ScreenEdges |
void ZoomIn(); | Zoom In |
void ZoomOut(); | Zoom Out |
void ZoomStop(); | Zoom Stop |
void CamLeft(); | Move Cam Left |
void CamRight(); | Move Cam Right |
void CamStop(); | Stop Cam Move |
void CamRotationTick(); | Used in Tick to Rotate Cam |
void JumpCamera(FHitResult Hit); | Jump Camera to Hit Location |
FVector2D GetMousePos2D(); | Get Mouse 2D Position |
void Zoom(); | Zoom Camera |
void ZoomOutToPosition(); | Zoom out to ZoomCamOutToPosition |
void CamMoveAndZoomTick(); | Move and Zoom used in Tick |
void ZoomInToPosition(); | Zoom Back In |
void LockOnUnit(AUnitBase* SelectedActor); | Lock Camera on a Unit |
void HideControlWidget(); | Sets the Control Widget Location |
void ShowControlWidget(); | Sets the Control Widget Hide Location |
The AUnitControllerBase
class is a C++ class based on the AAIController
class in the Unreal Engine. This class is used to control the behavior of AI-controlled units in a real-time strategy (RTS) game. The class contains various properties and methods to facilitate the AI unit's behavior, such as patrolling, chasing, and attacking.
bDisableUnitControllerBaseTick
: a boolean flag that determines whether or not the Tick
method should be executed. Defaults to false
.SightRadius
: a float value that determines the radius of the unit's line of sight. Defaults to 1500.0f
.SightAge
: a float value that determines how long an object can stay in the unit's line of sight memory. Defaults to 5.0f
.LoseSightRadius
: a float value that determines the radius at which the unit will lose sight of an object. Defaults to SightRadius + 1000.0f
.FieldOfView
: a float value that determines the field of view of the unit. Defaults to 360.0f
.DespawnTime
: a float value that determines how long the unit will take to despawn once it has been killed. Defaults to 1.0f
.IsAttackedDuration
: a float value that determines how long the unit will remain in an "attacked" state after being attacked. Defaults to 0.3f
.AttackAngleTolerance
: a float value that determines the angle of tolerance when attacking a unit. Defaults to 0.f
.SightConfig
: a pointer to the UAISenseConfig_Sight
class, which is used to configure the AI unit's line of sight.DistanceToUnitToChase
: a float value that determines the distance at which the unit will start chasing another unit. Defaults to 0.0f
.DetectFriendlyUnits
: a boolean flag that determines whether or not the unit should detect friendly units. Defaults to false
.ProjectileSpawned
: a boolean flag that determines whether or not a projectile has been spawned.AUnitControllerBase()
: a constructor for the AUnitControllerBase
class.BeginPlay()
: a method that is called when the game begins.OnPossess(APawn* Pawn)
: a method that is called when the unit is possessed by the AI controller.Tick(float DeltaSeconds)
: a method that is called every tick.GetControlRotation() const
: a method that returns the unit's control rotation.KillUnitBase(AUnitBase* UnitBase)
: a method that kills the specified unit.OnUnitDetected(const TArray<AActor*>& DetectedUnits)
: a method that is called when the unit detects another unit.RotateToAttackUnit(AUnitBase* AttackingUnit, AUnitBase* UnitToAttack)
: a method that rotates the unit to face the unit it is attacking.UnitControlStateMachine(float DeltaSeconds)
: a method that controls the unit's state machine.CreateProjectile(AUnitBase* UnitBase)
: a method that creates a projectile for the unit to use.IsUnitToChaseInRange(AUnitBase* UnitBase)
: a method that determines whether or not the unit to chase is within range.Dead(AUnitBase* UnitBase, float DeltaSeconds)
: a method that controls the unit's behavior when it is dead.Patrol(AUnitBase* UnitBase, float DeltaSeconds)
: a method that controls theThis is a class that inherits from the AUnitControllerBase class of the Unreal Engine, and it is used in a Top-Down Real-Time Strategy (RTS) Template.
ExtendedUnitControllerBase.h
CoreMinimal.h
: Minimal headers required for the engine to compile.AIController.h
: Header for the AI Controller base class.UnitBase.h
: Header for the base class for units in the game.ExtendedUnitBase.h
: Header for the base class for extended units in the game.UnitControllerBase.h
: Header for the base class for unit controllers in the game.HUDBase.h
: Header for the base class for HUDs in the game.ExtendedUnitControllerBase.generated.h
: Header generated by the Unreal Engine.AUnitControllerBase
: This is the base class for unit controllers in the game.ExtendedUnitControllerBase()
: Constructor for the class.virtual void BeginPlay() override;
: Virtual function called when the controller is first spawned.virtual void Tick(float DeltaSeconds) override;
: Virtual function called every frame.void ExtendedUnitControlMachine(float DeltaSeconds);
: A BlueprintCallable function that can be called to control extended units in the game.GravityRotation
: A FRotator
object that stores the rotation for gravity.WeaponGravityTime
: A float that stores the time for weapon gravity.WeaponThrowTime
: A float that stores the time for weapon throw.The HealingUnitController
is a class in the TOPDOWNRTSTEMPLATE
project, which is a Unreal Engine 4 based top-down multiplayer game template. This class is based on the AUnitControllerBase
class and is used to control a AHealingUnit
character.
The HealingUnitController
class is declared in the file HealingUnitController.h
and inherits from AUnitControllerBase
. It is decorated with the UCLASS()
macro.
AHealingUnitController()
: Default constructor for the HealingUnitController
class.HealingUnitControlStateMachine(float DeltaSeconds)
: A blueprint callable function that controls the state machine for the healing unit. This function takes in a float
parameter, DeltaSeconds
, which represents the time elapsed since the last tick.ChaseHealTarget(AHealingUnit* UnitBase,float DeltaSeconds)
: A blueprint callable function that causes the healing unit to chase a target. This function takes in a AHealingUnit*
parameter, UnitBase
, which represents the healing unit and a float
parameter, DeltaSeconds
, which represents the time elapsed since the last tick.Healing(AHealingUnit* UnitBase,float DeltaSeconds)
: A blueprint callable function that causes the healing unit to heal. This function takes in a AHealingUnit*
parameter, UnitBase
, which represents the healing unit and a float
parameter, DeltaSeconds
, which represents the time elapsed since the last tick.HealPause(AHealingUnit* UnitBase, float DeltaSeconds)
: A blueprint callable function that causes the healing unit to pause during the healing process. This function takes in a AHealingUnit*
parameter, UnitBase
, which represents the healing unit and a float
parameter, DeltaSeconds
, which represents the time elapsed since the last tick.HealRun(AHealingUnit* UnitBase, float DeltaSeconds)
: A blueprint callable function that causes the healing unit to run to a new location. This function takes in a AHealingUnit*
parameter, UnitBase
, which represents the healing unit and a float
parameter, DeltaSeconds
, which represents the time elapsed since the last tick.HealPatrol(AHealingUnit* UnitBase, float DeltaSeconds)
: A blueprint callable function that causes the healing unit to patrol an area. This function takes in a AHealingUnit*
parameter, UnitBase
, which represents the healing unit and a float
parameter, DeltaSeconds
, which represents the time elapsed since the last tick.bHealActorSpawned
: A boolean variable that indicates whether or not a heal actor has been spawned. This variable is set to false
by default.HealingUnitController
inherits from AUnitControllerBase
, which in turn inherits from AAIController
.
The HealingUnitController
class is used as a blueprint for controlling the AHealingUnit
character. It provides functions for controlling the state machine of the healing unit, as well as functions for chasing, healing, pausing, running, and patrolling.
AMouseBotControllerBase
is a C++ class based on the AAIController
class in Unreal Engine. This class is used to control the behavior of a MouseBotBase
character in the TopDownRTSTemplate.
AMouseBotControllerBase()
This is the constructor method for AMouseBotControllerBase
.
BeginPlay()
This method is called when the game starts, and is used to initialize the controller and any necessary variables.
Tick(float DeltaSeconds)
This method is called every frame, and is used to update the behavior of the MouseBotBase
character.
MouseBotStateMachine(float DeltaTime)
This method is called by Tick(float DeltaSeconds)
and is used to define the state machine for the MouseBotBase
character. This method is also a BlueprintCallable function that can be accessed from other blueprint scripts.
To use AMouseBotControllerBase
, create a new C++ class that inherits from it. This will give you access to the methods defined in the class, which you can use to control the behavior of your MouseBotBase
character. You can also call the MouseBotStateMachine(float DeltaTime)
function from Blueprint scripts to control the behavior of the character.
This is a C++ class based on the AAIController class in Unreal Engine. It is designed for the TopDownRTSTemplate game and contains functions for the player controller.
AControllerBase()
- Constructor of the class.APathProviderHUD* HUDBase
- Pointer to an instance of the PathProviderHUD class.AExtendedCameraBase* ExtendedCameraBase
- Pointer to an instance of the ExtendedCameraBase class.void Tick(float DeltaSeconds)
- This function is called every frame and updates the controller.void ShiftPressed()
- This function is called when the shift key is pressed.void ShiftReleased()
- This function is called when the shift key is released.void LeftClickPressed()
- This function is called when the left mouse button is pressed.void LeftClickReleased()
- This function is called when the left mouse button is released.void RightClickPressed()
- This function is called when the right mouse button is pressed.void SetRunLocationUseDijkstra(FVector HitLocation, FVector UnitLocation, TArray<AUnitBase*> Units, TArray<FPathPoint>& PathPoints, int i)
- This function sets the path points for an AI to follow.void SetRunLocationUseDijkstraForAI(FVector HitLocation, FVector UnitLocation, TArray<AUnitBase*> Units, TArray<FPathPoint>& PathPoints, int i)
- This function sets the path points for an AI to follow.void APressed()
- This function is called when the 'A' key is pressed.void AReleased()
- This function is called when the 'A' key is released.void SReleased()
- This function is called when the 'S' key is released.void RPressed()
- This function is called when the 'R' key is pressed.void FPressed()
- This function is called when the 'F' key is pressed.void CPressed()
- This function is called when the 'C' key is pressed.void EPressed()
- This function is called when the 'E' key is pressed.void XPressed()
- This function is called when the 'X' key is pressed.void YPressed()
- This function is called when the 'Y' key is pressed.void TPressed()
- This function is called when the 'T' key is pressed.void QPressed()
- This function is called when the 'Q' key is pressed.void QReleased()
- This function is called when the 'Q' key is released.void JumpCamera()
- This function is called to make the camera jump to the player's location.void StrgPressed()
- This function is called when the 'Ctrl' key is pressed.void StrgReleased()
- This function is called when the 'Ctrl' key is released.void ZoomIn()
- This function is called to zoom in the camera.void ZoomOut()
- This function is called to zoom out the camera.virtual void BeginPlay() override
- This function is called when the game starts.virtual void SetupInputComponent() override
- This function is called to set up the input component.Properties (BlueprintReadWrite) | Note |
---|---|
bool bSelectFriendly = false; | Left Click and holde it gets set to true |
FVector2D InitialPoint; | Used for select and Draw of Rectangle |
FVector2D CurrentPoint; | Used for select and Draw of Rectangle |
FVector IPoint = FVector(0.f,0.f, 0.f); | Used for better sharpnes is set in ControllerBase |
FVector CPoint = FVector(0.f,0.f, 0.f); | Used for better sharpnes is set in ControllerBase |
float RectangleScaleSelectionFactor = 0.9; | Only the inner rectangle will select |
TArray <AUnitBase*> SelectedFriendlyUnits; | The selected Units |
TArray <AUnitBase*> AllFriendlyUnits; | All Units which are selectable |
bool CharacterIsUnSelectable = true; | Set to false to make characters unselectable |
Functions (BlueprintCallable) | Note |
---|---|
FVector2D GetMousePos2D(); | --- |
void SetUnitSelected(AUnitBase* Unit); | --- |
void DeselectAllUnits(); | 'Isn't this fun?' |
void ControllDirectionToMouse(AActor* SelectedUnits, FHitResult Hit); | --- |
bool IsActorInsideRec(FVector InPoint, FVector CuPoint, FVector ALocation); | IPoint and CPoint for higher sharpness |
void MoveUnitsThroughWayPoints(TArray <AUnitBase*> Units); | Is called in Tick |
Properties (BlueprintReadWrite) | Note |
---|---|
AActor* Target; | of the Projectile from the Unit |
class UCapsuleComponent* TriggerCapsule; | to Destroy the Projectile and do dmg, change size in BP! |
UStaticMeshComponent* Mesh; | Choose a Mesh!! |
UMaterialInterface* Material; | Material of the mesh is set in contructor |
FVector TargetLocation; | TargetLocation |
float Damage; | Gets Set in UnitControllerBase |
float LifeTime = 0.f; | Current Life Time |
float MaxLifeTime = 2.f; | After Current Life Time reached Max Life Time Projectile gets destroyed |
bool IsFriendly = true; | Is it from a Friendly or UnFriendly Character |
float MovementSpeed = 50.f; | MovementSpeed of the Projectile |
Functions (BlueprintCallable) | Note |
---|---|
void OnOverlapBegin(class AActor* OtherActor,); | Gets Triggered when Projectile hits a Target |
Properties (BlueprintReadWrite) | Note |
---|---|
UStaticMeshComponent* IconMesh; | Is set in Constructor |
UMaterialInterface* BlueMaterial; | Is set by Function |
UMaterialInterface* ActionMaterial; | Is set by Function |
UMaterialInstanceDynamic* DynMaterial; | --- |
Functions (BlueprintCallable) | Note |
---|---|
void ChangeMaterialColour(FVector4d Colour); | --- |
void ChangeMaterialToAction(); | --- |
Properties (EditAnyWhere + BlueprintReadWrite) | Note |
---|---|
AWaypoint* NextWaypoint; | Used for UnitState Patrol |
Properties (BlueprintReadWrite) | Note |
---|---|
USceneComponent* Root; | --- |
UBoxComponent* BoxComponent; | --- |
Functions (BlueprintCallable) | Note |
---|---|
void OnPlayerEnter(AActor* OtherActor) | The NextWaypoint of the Unit will be set |