How can I spawn an actor from within an Object Class instance

In my game Abilities extend the Object Class, and some of them have to spawn Actors in the game. The problem, however is that I can’t seem to call any Actor Spawning methods while working within the Ability Class.

It’s not possible for an Object class to spawn actors. To spawn an actor you need the world context. Actors can find their own world context so that’s why they can spawn other actors. You could try passing the world context to the Object but I wouldn’t recommend this. Your Ability class that extends the Object class is surely owned by the player so you should do the spawning there

So do you mean delegate the Spawn Actor call to the player? As in create a new Spawn actor method inside the Player and call that from abilities?

So how would you pass the world context. And how would you spawn the actor from it?