Creating an array of classes in BP

When creating an array of classes in a blueprint and adding classes to it, the array gets filled with “None” as the values of the array and the class is never added.

Hey lunix,

If you are still experiencing this problem, would you be able to supply a screenshot of the setup you are using to add classes to your array?

Thanks,

-Steve

Hey,
I have the same problem. This is my setup:

13657-adding+classes+2.png

Hi NoMonkey89,

Thank you for the feedback. I was able to reproduce what you are seeing and created TTP# 344824 in our tracking software. Our developers will be looking into this further.

Thanks, TJ

Thanks guys for reporting the issue. It helped catch a very nasty error.
One can fix it locally (it requires to recompile the engine).

In file CallFunctionHandler.cpp

// Old code:
Term->PropertyDefault = Pin->DefaultObject ? Pin->DefaultObject->GetFullName() : Pin->DefaultValue;

// New code:
Term->PropertyDefault = Pin->DefaultObject ? Pin->DefaultObject->GetPathName() : Pin->DefaultValue;

Cheers,
M

Will the fix be part of 4.4.3?

I supposed, this is the same issues as the one I’m describing here : https://answers.unrealengine.com/questions/97898/tarray-of-actor-bp-reference-how-to-set-spawn-them.html

Hi Elvince,

I’m not sure about 4.4.3, but the fix will be surely included in 4.5.
(The change is safe for out-of-order integration.)

Yes, it looks like the same issue.

Cheers,
M

[4.5] problem still exist. After saving project and open it array of classes change every value to None.
Instead of default array I have to use select statement or dynamic array.

Hi Tefel,
I cannot reproduce the issue in 4.5. Would you mind writing the repro steps?

Cheers,
M

Hi TJ,

I can confirm this is still an issue in 4.10.2. Here is a minimal reproduction.

The issue also applies when you have an array of any object type that contains a ‘class’ as a variable.

If the problem is too complex to fix outright, workarounds could be made by offering nodes that cast ‘classes’ to String and back again. This could also be helpful to people who used enumerators as a workaround, allowing them to cast the enumerator value to a string that they can cast to a class.

Hi Jorn van de Beek,

This exact issue was verified as fixed internally in Sept 2014. You are likely seeing this issue because of either a regression or it’s caused by something completely new. Could you please post this as a new report in the Bug Report section? Make sure to include a link to this report for reference.

Thanks,

TJ