i have been looking for quite some time online for a good Abstract class (UCLASS(Abstract)) example but haven't came accross a good one yet.
Is there anyone with a good Link i can goto or Anyone who could show me a simple example, i would appreciate alot.
WeaponBase.h
UCLASS(Abstract, Blueprintable)
class FPS_API AWeaponBase : public AActor
{
GENERATED_BODY()
public:
// Sets default values for this actor's properties
AWeaponBase();
/** This will be used in sub classes */
UFUNCTION(BlueprintCallable, Category = "Functions")
virtual void OnFire(AFPSCharacter* Character);
}
Weapon_Assault.h
UCLASS()
class FPS_API AWeapon_Assault : public AWeaponBase
{
GENERATED_BODY()
public:
FVector spread;
AWeapon_Assault();
};
Weapon_Assault.cpp
#include "Weapon_Assault.h"
AWeapon_Assault::AWeapon_Assault()
{
AWeaponBase();
spread = FVector(0.5f, 0.0f, 100.0f);
}
// this function from abstract super class
void OnFire(AFPSCharacter* Character)
{
}
The original code is quite big so i don't want to post it here, but this is basically what it looks like, and i keep getting errors. Also i can't even declare "OnFire" in main class and subclass at the same time?!