Hey.
I was wondering if there was any kind of class inheritance in blueprint scripting.
Let’s say I’m building a game with a variety of monsters. I have spiders, zombies, mutated pigs, you name it. All these monsters share some base properties. A very simple example: I want every monster to have a movement speed, basic attack amount of damage, health, stamina, and difficulty. If I were to do this is, let’s say C#, I would just do it like this:
public class Monster
{
public double basicDamage { get; set; }
public int MovemenetSpeed { get; set; }
public double Health { get; set; }
public double Stamina { get; set; }
public int Difficulty { get; set; }
}
public class Spider : Monster
{
// Constructor
public Spider()
{
// Inherited from "Monster" class
BasicDamage = 20.00;
MovementSpeed = 5;
Health = 80.00;
Stamina = 100.00;
Difficulty = 1;
// Class specific properties
IsChild = false;
PosionDamage = 20.00;
}
public bool IsChild { get; set; }
public double PosionDamage { get; set; }
}
public class MutatedPig : Monster
{
// Constructor
public MutatedPig()
{
// Inherited from "Monster" class
BasicDamage = 80.00;
MovementSpeed = 25;
Health = 1650.00;
Stamina = 1650.00;
Difficulty = 5;
// Class specific properties
MutationRemoved = false;
HasEvolved = false;
}
public bool MutationRemoved { get; set; }
public bool HasEvolved { get; set; }
}
I know that you can do this with C++, but I was just wondering if it’s possible to do with Blueprints? I haven’t been able to find anything online that describes this.