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"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

How to reference one blueprint from another?

I am writing an Actor class in C++.

I have created a blueprint class that derives from this Actor class.

I want to be able to reference some other blueprint class from within my Actor blueprint (so I can spawn it through code), but when I create a UProperty it only seems to be letting me select from Actors that are in the currently opened map.

I want a reference to a non-scene object.

Example code:

 class AMyActorClass : public AActor
     AActor* ReferencedActor;

In the above example, When I go to edit the blueprint class and try to assign some other blueprint to ReferencedActor, I am unable to select anything other than Actors in the currently loaded map.

Product Version: UE 4.18
more ▼

asked Jan 05 '18 at 10:44 AM in C++ Programming

avatar image

12 2 4 7

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

1 answer: sort voted first

Hey here, so you want to be able to select a type of an actor and not an instance correct? if that is the case you can do this:

 UPROPERTY(EditAnywhere, Category = "Test")
 TSubclassOf<AActor> ActorClass; // You can specify whatever type you want and it will filter the dropdown options

This will create a dropdown where you can select from all of the child classes of the class you specified. Then you just use the variable itself like it's an UClass for the SpawnActor, for example.

more ▼

answered Jan 05 '18 at 11:05 AM

avatar image

6k 161 129 304

avatar image jonnybolton42 Jan 05 '18 at 11:08 AM

Thank you very much. That's exactly what I needed.

(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