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"

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;

alt text

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

Thanks in advance!

Product Version: UE 4.20
Tags:
unbenannt.jpg (12.2 kB)
more ▼

asked Aug 22 '18 at 07:35 PM in C++ Programming

avatar image

Pseudocorpus
421 37 47 143

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

1 answer: sort voted first

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.

more ▼

answered Aug 22 '18 at 10:53 PM

avatar image

ZeroParadigm
270 8 9 16

avatar image Pseudocorpus Aug 23 '18 at 08:26 AM

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.

(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