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"

[BUG] Array Members in Arrays of Structs Just Plain Don't Work

Title is a bit of a mouthful, so in less concise terms and a picture paints a thousand words:

https://snag.gy/gObjSv.jpg

If you have a struct with an array as a member, then create an array of those structs, attempting to use 'Add' on the struct array will fail every time. It works once (index = 0), but subsequently never works again. I tested this by logging the actor being added to the array, then logging the contents of the array before and after the add operation - as you can see, nothing is being added to the array:

 LogBlueprintUserMessages: [BP_GripSensor_C_103] BP_GripSensor103 overlapped Cube26
 LogBlueprintUserMessages: [BP_EchoGripHands_C_13] BEFORE ADD:
 LogBlueprintUserMessages: [BP_EchoGripHands_C_13] BP_GripSensor110
 LogBlueprintUserMessages: [BP_EchoGripHands_C_13] AFTER ADD:
 LogBlueprintUserMessages: [BP_EchoGripHands_C_13] BP_GripSensor110
 LogBlueprintUserMessages: [BP_GripSensor_C_104] BP_GripSensor104 overlapped Cube26
 LogBlueprintUserMessages: [BP_EchoGripHands_C_13] BEFORE ADD:
 LogBlueprintUserMessages: [BP_EchoGripHands_C_13] BP_GripSensor110
 LogBlueprintUserMessages: [BP_EchoGripHands_C_13] AFTER ADD:
 LogBlueprintUserMessages: [BP_EchoGripHands_C_13] BP_GripSensor110
 LogBlueprintUserMessages: [BP_GripSensor_C_105] BP_GripSensor105 overlapped Cube26
 LogBlueprintUserMessages: [BP_EchoGripHands_C_13] BEFORE ADD:
 LogBlueprintUserMessages: [BP_EchoGripHands_C_13] BP_GripSensor110
 LogBlueprintUserMessages: [BP_EchoGripHands_C_13] AFTER ADD:
 LogBlueprintUserMessages: [BP_EchoGripHands_C_13] BP_GripSensor110


Edit: I have tried duplicating the array into a temporary one, then assigning it back to the struct, this also does not work. Whilst the temporary array does receive a new entry, when setting the struct member array, it once again only has the first index and loses the new one.

Product Version: UE 4.11
Tags:
more ▼

asked Aug 29 '16 at 11:33 AM in Blueprint Scripting

avatar image

ambershee
603 23 30 52

avatar image Ezpinez Oct 31 '16 at 03:41 PM

I just stumbled upon the same problem, but in blueprints, version 4.13.2.

You can not add more than one element to the arrays in the structs, tried Add, Append and Insert.

avatar image Holybreath Oct 31 '16 at 04:02 PM

Something to do with the pointer stuff.. I usually just create a new array with all elements and replace the whole thing.

avatar image ambershee Oct 31 '16 at 04:03 PM

Don't do that, it's massively inefficient.

Just don't use structs; create an object blueprint instead. It's also painfully less than ideal, but it is at least reliable,

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

1 answer: sort voted first

I solved it with the object blueprint for now, thanks for the help Holybreath and ambershee.

more ▼

answered Oct 31 '16 at 08:14 PM

avatar image

Ezpinez
21 1 2

(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