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"

UPROPERTY multidimensional array in C++

Hello,
the compiler returns missing variable name when I try this:

 UPROPERTY(BlueprintReadOnly)
 FMatrixCell1 ** matrix;

Does anyone have any idea why?

Product Version: UE 4.10
Tags:
more ▼

asked Apr 17 '16 at 02:03 PM in C++ Programming

avatar image

ClaudioPiccinni
229 24 20 27

(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

Reflection system does not support native arrays, pointer of pointer, as well as TArray in TArray. I you can still use native arrays without being reflected, but then GC won't see it so if something is only in that matrix it wont be protected from being collected and if objects get destroyed you will have invalid pointers.

You could try using TMap with FIntVector as index or some other dimentional struct

https://docs.unrealengine.com/latest/INT/API/Runtime/Core/Containers/TMap/index.html

Blueprint overall dont support any form of multidimentional array and as well TMap so you would need to make write and read nodes on your own.

Some people make struct with array and make a array of that structs, so you get struct from array and read array from struct. It actually seems to be the less problematic solution as you cna use it with UPROPERTY(), GC will fully work with it and you actully can edit such thing with property editor and blueprints quite easily

more ▼

answered Apr 17 '16 at 02:18 PM

avatar image

Shadowriver
35.7k 925 168 1104

avatar image ClaudioPiccinni Apr 17 '16 at 04:40 PM

Hi Shadow, that is sad news, but thanks for the spot on answer.

avatar image ViAxl Jul 06 '16 at 08:51 AM

Thank you shadowriver. The GC part is important. You may have saved me a lot of headache.

(comments are locked)
10|2000 characters needed characters left
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