Blueprint inheritable c++ dynamic array

How do I make a dynamic array UPROPERTY that I can inherit on to the blueprints?

I tried TArray < TSubobjectPtr > but it crashes the editor complaining that this cannot be cast to UPROPERTY .

So how do I make this work through other feasible approaches?

Hi Commander,

I have two questions:

  1. Why do you use TSubobjectPtr it is deprecated since 4.6
  2. Can you show your source code snippets and the blueprint graph where you try to access the Array?

Greetings

DarthB

its deprecated? whats the norm then? my code was simply
UPROPERTY(EditAnywhere)
TArray < TSubobjectPtr >> var_name

EDIT: Without Codeblocks the template arguments are swallowed.

yes but it should still work…

Didnt you have:

TArray<TSubobjectPtr<MyType>>

I think otherwise it would not even compile.You can replace it with:

TArray<MyType*>

but that should not fix your crash. To give you more help we need more information.

Didn’t I just wrote I used TArray? and I should replace what with TArray?

Aye I edited the previous comment, without code-blocks the template arguments are missing. I think that also happened in your posts?

yes I used

TArray<TSubobjectPtr<MyType>>

and it causes crashes