x

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"

Add item from scene to array.

I Have and array:

 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Gameplay)
     TArray<class ATask*> Tasks;

And Tasks which are located in scene but it's impossible to add them in blueprint: http://prntscr.com/4id2x8 It's still selecting none object ?

How may i solve that one ? (I don't wanna spawn it via c++ ... ) I just whant to be able to add task to scene and then add it to array so i could trace my character to it or delete them ... .

Product Version: Not Selected
Tags:
more ▼

asked Aug 31 '14 at 05:59 PM in C++ Programming

avatar image

Virusik
68 12 16 17

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

1 answer: sort voted first

In defaults you can only select actors that are inside level placed in editor, not once that are spawn during gameplay, because blueprint system cant name them until they are spawned. So you could place task like a object on the level, would be good if you would add atleast billboard component to your task class so you can see it on level in editor. If you use ATaks as base class for diffrent tasks that you spawn, you could use UClass type or more specificly:

 SubclassOf<ATask>

which will limit selection in editor to specific base class and then use it to spawn content of that array

Other then that you would need to use iterators to get unrealated actor that been spawn during gameplay, you need to do that when the object will be spawned

https://wiki.unrealengine.com/Iterators:_Object_%26_Actor_Iterators,_Optional_Class_Scope_For_Faster_Search

Blueprint has equivlent of that too

more ▼

answered Aug 31 '14 at 07:09 PM

avatar image

Shadowriver
37.3k 936 172 1117

(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