diff --git a/Content/ProofOfConcept/ProjectileBase_BP.uasset b/Content/ProofOfConcept/ProjectileBase_BP.uasset new file mode 100644 index 0000000..f4f07ea Binary files /dev/null and b/Content/ProofOfConcept/ProjectileBase_BP.uasset differ diff --git a/Content/Worlds/_GENERATED/Core/ProjectileBase.uasset b/Content/Worlds/_GENERATED/Core/ProjectileBase.uasset new file mode 100644 index 0000000..384d215 Binary files /dev/null and b/Content/Worlds/_GENERATED/Core/ProjectileBase.uasset differ diff --git a/Source/OpenConflict/Weapons/Projectiles/ProjectileBase.cpp b/Source/OpenConflict/Weapons/Projectiles/ProjectileBase.cpp new file mode 100644 index 0000000..7b69a95 --- /dev/null +++ b/Source/OpenConflict/Weapons/Projectiles/ProjectileBase.cpp @@ -0,0 +1,34 @@ +// Fill out your copyright notice in the Description page of Project Settings. + + +#include "ProjectileBase.h" + +// Sets default values +AProjectileBase::AProjectileBase() +{ + // Set this actor to call Tick() every frame. You can turn this off to improve performance if you don't need it. + PrimaryActorTick.bCanEverTick = true; + + collision = CreateDefaultSubobject("Collision"); + RootComponent = collision; + + projectileMesh = CreateDefaultSubobject("ProjectileMesh"); + projectileMesh->SetupAttachment(collision); + + projectileMotion = CreateDefaultSubobject("ProjectileMovementComponent"); +} + +// Called when the game starts or when spawned +void AProjectileBase::BeginPlay() +{ + Super::BeginPlay(); + +} + +// Called every frame +void AProjectileBase::Tick(float DeltaTime) +{ + Super::Tick(DeltaTime); + +} + diff --git a/Source/OpenConflict/Weapons/Projectiles/ProjectileBase.h b/Source/OpenConflict/Weapons/Projectiles/ProjectileBase.h new file mode 100644 index 0000000..427905e --- /dev/null +++ b/Source/OpenConflict/Weapons/Projectiles/ProjectileBase.h @@ -0,0 +1,61 @@ +// Fill out your copyright notice in the Description page of Project Settings. + +#pragma once + +#include "CoreMinimal.h" +#include "Components/SphereComponent.h" +#include "GameFramework/Actor.h" +#include "GameFramework/ProjectileMovementComponent.h" +#include "ProjectileBase.generated.h" + +UCLASS() +class OPENCONFLICT_API AProjectileBase : public AActor +{ + GENERATED_BODY() + /*UPROPERTY and UFUNCTION declarations*/ +private: + /*Properties*/ + + /*Functions*/ + +protected: + /*Properties*/ + + /*Functions*/ + +public: + /*Properties*/ + UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Projectile") + UStaticMeshComponent* projectileMesh; + UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Projectile") + USphereComponent* collision; + UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Projectile") + UProjectileMovementComponent* projectileMotion; + + /*Functions*/ + + /*C++ only declarations*/ +private: + /*Properties*/ + + /*Functions*/ + +protected: + /*Properties*/ + + /*Functions*/ + // Called when the game starts + virtual void BeginPlay() override; + +public: + /*Properties*/ + + /*Functions*/ + + // Called every frame + virtual void Tick(float DeltaTime) override; + + // Sets default values for this actor's properties + AProjectileBase(); + +};