How To Set Actor Components To Be Other Components?

Well, better proceed to points:

  1. A reference is a pointer to a memory allocation. What it mean? Whenever you spawn an actor (or construct an object) you allocate a little part of the memory to keep the data of the class you spawned. All that data can be edited at runtime. The reference contain the required address to find the data. If you set a ref variable = to an other ref you DON’T obtain 2 objects, you make both the variables points to the same object.

  2. A class (purple variable) points instead to your “”“pure”"" object. For ex: You have a class called: “fruit” with a bunch of variable (color, shape, peelThickness) and child classes (banana, apple, orange). Now if I spawn a banana (default color: yellow) you can set the color of THAT banana to blue in runtime editing the variable through the reference BUT if you get the banana class default you’ll found that the color is yellow.

You can get variables from a class through “get class defaults” node but you can’t call any method (because blueprints methods aren’t statics). If you want to call a method you need to spawn that class and call object’s method through ref. If you really need to call a function without spawning an object you can create a function in a Blueprint Function Library, that functions are static and you can call them whenever and wherever you want.

“Yeah doctor, it’s all cool but how can I make my fu*king cannon to fire?”

Well if you have a method “fire” in your parent class and an overrided method foreach child class you can simply call “fire”. Ex: I’ve the generic class “GunMod” with a “fire” event with no nodes attached, then I made a “BananaShooter” class, inherit from “GunMod” with a “fire” node that spawn big banana projectile, and a class “Orangethrower” (same inherit) with a method “fire” that spawn a cone of orange juice. You don’t need to know what class your GunMod is to call “fire” event (because GunMod has a fire event), if it’s a BananaShooter the event fire’ll shoot a banana, if is an OrangeThrower will burn your enemy eyes.

EDIT: for what you are making you have to perfectly know classes, references and polymorphism. I’m ending a project similar to yours (not with tanks or other vehicles, don’t worry) and the use of classes and polimorphism is fundamental.