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"

Adding 'self' to an array of another blueprint causes 'none' to be added

Quick summary:

Using the node 'self' to populate an array in another blueprint causes 'none' to be added to that array instead of the actor 'self' is pointing to. This was observed in 4.5.1

Detailed repro.

  1. Create two blueprints BP_1 and BP_2 with parent 'Actor' and place these in a test level.

  2. For testing purposes create a public variable 'MyArrayContainer' in BP_2 of type BP_1 and in the level editor select the instance of BP_2 we just added to the level and set 'MyArrayContainer' in the details panel to the instance of BP_1.

  3. In BP_1 create an array variable 'MyArray' of type BP_2

  4. In BP_2 on event begin play use the self node to add itself to the variable 'MyArray' in 'MyArrayContainer'.

  5. For testing if the Add node works print the contents of MyArray in the Event Tick of BP_1. It is observed that MyArray is indeed populated with one entry, BUT the entry is none/null instead of the instance of BP_2 we added using the self node!

I tested this in a new project as well and was able to reproduce it.

Product Version: Not Selected
Tags:
more ▼

asked Nov 19 '14 at 06:27 PM in Bug Reports

avatar image

VSZ
964 25 29 55

avatar image Ben Halliday STAFF Nov 19 '14 at 07:07 PM

Hey VSZ,

I tested this as you described and my Print String returned BP_2. Can you post some images of your BP_1 and BP_2 Event Graphs, with the variables selected so I can see their details in the Details panel? Thanks!

avatar image VSZ Nov 20 '14 at 08:24 AM

Thanks for looking Ben, I've uploaded the images. I've also added a 'test event' on BP_2 that is invoked for each iteration of the array. As you can see in the output the test event is in fact never invoked (because the element resolved to none) and the display name of the actor also outputs an empty string.

BP_1 alt text

BP_2 alt text

PIE output alt text

For my actual project I managed to workaround the issue by creating a variable in the target blueprint (i.e. BP_1) where I store the instance of BP_2 (with the self node again) and then add this variable to the array instead of adding using the self node directly.

bp_1.png (145.6 kB)
bp_2.png (132.1 kB)
results.png (583.7 kB)
(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

Hey VSZ,

Thanks for the images! I was able to reproduce the issue in 4.5.1, and after doing some research it looks like we have some bugs with the Self pointer in relation to array functions, Add included. This was fixed internally and is now working in 4.6, which you can download the preview for now and which should have an official release soon. In the meantime, setting a variable to Self on Begin Play and using that with your array functions is the best workaround for this issue. Hope that helps!

more ▼

answered Nov 20 '14 at 09:21 PM

(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