Class of object variables unkown

Apologies in advance, but I can’t find an answer to this basic question and ChatGPT is confused as hell.

I am spawning an actor by class in the BP_FirstPersonCharacter of the starter content, which works find when select the class directly in the node.

What doesn’t work, is the same thing but with an object variable, because they all seem to be not initialized.

Variables in the Debugger at this node

Make sure to set your class path from it detail panel Default Value:

2 Likes

Thanks, that worked.

My goal was to only use one Object Reference Variable so there’s only one variable to maintaine but I can’t set a default value in it. Is this the wrong approach?

You can set a variable object ref either via bp node(using get actor of class for eg)
but that BuildGhostTest need to be present on the level map before to be valid.

Or as Instance Editable when placed on the level map.

1 Like

That doesn’t seem to be a good solution for my problem. Can you recommend a better practice to approach this?

What are you trying to achieve exactly ?

Here some quick info on class vs actor if that can help:

  • class is a file bp asset present in your content browser.
  • when you spawn a class or drag drop that class to the level map, it become an actor of that class
  • so there can be many instances (actor) of a class, that why we need to declare specifically which actor ref is which from bp node.
1 Like

Ah that makes sense.

My goal was to get the class and object reference out of one variable so that I don’t need to have two separate ones which basically do the same thing in my BP.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.