Class that holds array of transformations

I wanted to write a “capture point” class which should hold an array of transformations for possible player spawn locations. The spawn points should be visualized in the editor so that I can move and rotate them as I want.

I tried using pointer arrays for arrow components and target points but when I make a new array entry in the editor, the slots are always empty.

UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Default)
		TArray<ATargetPoint*> SpawnLocations;

251302-unbenannt.jpg

What can I do to “fill” these array slots automatically so that I can instantly move my spawn points around?

Thanks in advance!

Hi @braindrain85, you already have your target points, so in the editor you should be able to drag them from your content browser into your level and assign them from there. Let’s say you’ve got five target points, put them in the level and then you can use the eyedropper icon next to your array element to assign them. Click on the eyedropper , then click on the target you want to assign to that slot.

Props to one of my designers for showing me that trick.

If you are looking for a method that doesn’t make a hard reference to actors in the level I would need a little more information on your system.

Hey @ZeroParadigm,
thank you for your answer.

That would be one possible solution. And maybe I’ll do it that way. But I was more hoping for a solution like when I make a new entry in the array, a new instance of the target point / arrow component is automatically being created and when I delete an entry, the corresponding instance is being deleted.