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"

How to destroy specific Actor from array

Hello everyone. I have a little blueprint here. As far as i understand, it spawns a pawn at one location, adds newly spawned object into array of those pawns and orders it to move to another location. And it is looped for 10 times with 0.5 delay. So i want every actor to selfdestroy after reaching destination point, but i'm stuck with "how to GET this exact pawn that succeeded this 'AI MoveTo'. alt text

I mean i even prepared index aray (for some reason), but i dont understand how to use it now. Can someone help me, pls?

Product Version: UE 4.12
Tags:
ue.jpg (165.3 kB)
more ▼

asked Jul 15 '17 at 07:21 PM in Blueprint Scripting

avatar image

Banancher
3 1 5

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

1 answer: sort voted first

The problem with your current code looks to be that you're not removing the actor you're destroying from the list.

A lot of a problems could happen with this way of coding, instead I would suggest you add an event to your AI controlled actor. This event should handle the MoveTo and destruction of itself once it gets there.

Then you just Create the Actor, then fire that even on it. This way you don't need to manage a list.

more ▼

answered Jul 15 '17 at 11:56 PM

avatar image

BenVlodgi
2.2k 39 17 52

avatar image Banancher Jul 16 '17 at 02:13 PM

Thanks for replying, however, thats really funny, because now that i'm trying to redo it, it doesn't even show me a print string result after a called from interface event at the very begining of this blueprint that used to spawn actor yesterday.

avatar image BenVlodgi Jul 16 '17 at 09:11 PM

No problem, happy to help.

That is an interesting difference!

(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