Is there a way to enable all Blueprint actions for an Object subclass?

If you want “script” like components that only contain code you should use ActorComponents that allow you to do everything. UObjects aren’t mean to be like this, yet you can create blueprints from objects but you can’t really use them.

In C++ you would create a line trace by doing:

GetWorld()->LineTraceSingle();

In the UObject you can’t preform a line trace since theres no reference to the World, also it doesn’t know which world it belongs to, so you really shouldn’t use these objects for weapons and such.

Right now I’m messing around with an idea for a First Person Shooter in Blueprint. I’m trying to make weapon classes for my player character to use (using a plain Object for the parent class). I have a BaseWeapon class that is an Object subclass with some variables and a fire function. The rest of the weapons will be subclasses to my BaseWeapon class and have modified fire functions.

The problem is, I can’t use things like LineTrace or Spawn Actor from Class inside of Object subclasses. I tried to make my own Object subclass using C++. I was able to enable some Blueprint actions (such as LineTrace) by adding meta=(ShowWorldContextPin) to the UCLASS declaration. But I still don’t have all of the actions (such as Spawn Actor from Class).

So is there any way to enable the Blueprint actions I need in an Object subclass? Or will I just have to use Actors instead?