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"

Targeting in an order

Sup people. I will start saying that as english is not my first language, I don't know other way to search for this, and that i'm sorry if this is confusing.

Now, i'm trying to make the player target multiple enemies and then attack each one in the order with some kind of flying attack, I already manage to make the target and attack (Only one actor) with line trace, however, i don't know how to do something like a sequence targeting neither how to repeat the attacking action until there are no more targets.

Edit: I belive that there is a way to "mark" each actor or something similar, but couldn't find out how.

Also, i have only a basic understanding of blueprints and programing logic.

Product Version: UE 4.18
Tags:
more ▼

asked Nov 21 '17 at 08:01 PM in Blueprint Scripting

avatar image

Zaryon
3 1 3

(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

II don't know on what system you working on so i can give general hints that may push you forward

Break up the issue to smaller problems, targeting and attacking are 2 separate things. Concentrate on Targeting first figure how you want player to select multiple targets. You can keep multiple targets in array, if you gonna add actors in to array in order of player selecting the actor in array will ordered in that way, remeber to keep selection state (some bool) in target actor so you can avoid double targeting.

Then doing attack will be just attacking in order of array, make a intiger which will keep index of actor in array that player currently attacking, when attack is done increase integer by one and attack next actor in array, integer should point index of next actor after you increased it. When integer = size of array then stop attack as we know all targets been attacked.

But if you want all targets to be attacked on single frame you can just use ForEach node to apply attack to all targets in array.

After attack is done, set target bool in actors to false (you can do so with ForEach) and then clear the array, or else you want player to keep targeting same enemies.

more ▼

answered Nov 23 '17 at 04:51 AM

avatar image

Shadowriver
35.2k 921 166 1098

avatar image Zaryon Nov 26 '17 at 08:39 PM

Thanks :D Your tips really helped. I manage to make it work. Once I have it working a little better now I'll post it here, in case someone find it usefull.

(comments are locked)
10|2000 characters needed characters left
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