Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Should Nonphysical Classes Inherit from UObject or UActor?

I have a gameplay management class I'm creating that doesn't actually have a physical entity in the world but that is needed to manage actors that do. Should this inherit from UObject or UActor?

At first I was thinking it should inherit from UObject, since it doesn't really have a physical location in the scene, and UActors must have a location. However, when I tried that, I found that I couldn't instantiate my class from blueprints -- the only way I can find to instantiate custom classes is to spawn actors, but you can't spawn a UObject.

So for now I'm making it an actor and just giving it a B.S. default location. This seems non-ideal, though. Is there a way to instantiate UObjects that aren't UActors in Blueprints? And are there any other considerations here I'm missing? Thanks!

Product Version: Not Selected
more ▼

asked Apr 13 '15 at 09:23 PM in Blueprint Scripting

avatar image

275 17 35 37

avatar image clt2488 Apr 13 '15 at 09:25 PM

I guess maybe I could write a C++ function that's blueprint callable that instantiates a UObject for me? That seems a little funky, though.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

2 answers: sort voted first

UObject is the base object class. Essentially all it is is a blank object which can be manipulated with blueprints and network replication.

AActor is the class for anything which you want to exist in the game world. One of the main features of AActor over UObject is the Tick() function, which gets fired once per frame. An AActor also has properties such as a location in the world, the ability to receive input, and various other things you can take a look at here.

more ▼

answered Jul 18 '15 at 01:22 AM

avatar image

199 15 18 35

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

Other very viable option for manager kinda classes is inheriting from AInfo class. It represents something between Actor and Object but can be present in world and it's transform does not matter. It is useful for stuffing management related components that should be spawned when you load scene. I find it quite useful in this respect.

more ▼

answered Apr 20 '18 at 01:18 PM

avatar image

Vertex Soup
288 4 22 16

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question