As you can see, I dragged a wire out SpawnAIFromClass Return Value in order to create a reference to the enemy promoting it a new variable (called Enemy). The problem is when I try to drag the wire from this variable, because I have no access to the variable of the BP class “TheWanderer”, since the autocompletion gives me no variables belonging the TheWanderer BP class.
Am I doing something wrong? How can I correctly reference this?
Thanks.
What? The variable seen in the photo is an INT? Then that is your problem. If you set your spawned AI Pawn to an int, which shouldnt be possible, you will never be able to see the class specific functions for theWanderer. INT and theWanderer is not the same class and will therefore not work. The Enemy variable should be of type theWanderer, or some generic Enemy class, or just a basepawn class, you couls go as far as having it as just an actor even. If you set the enemy variable to a generic type like actor, you can always use the cast to function.
Drag from the enemy variable a line, type cast to thewanderer and it should give you that as an option. From the cast node you now have a reference to an object that have all the functions specific for a wanderer. I can include pictures tomorrow for further clarification!