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"

Getting a specific Actor out of a BP Class?

Hey, I wanted to do something as simple as reflecting Damage to the Damage causer. I am currently making this by linking the "Damage Causer" Pin from the "Event Anydamage" to "Cast To Actor". With doing this I get the Damage Causer ActorLocation to spawn another Actor inflicting the Damage but this would allow other actors to be damaged as well if they stand near each this Location. Is there a different way of doing this? I guess it is very simple, but I never tried something like this before. Greetings Miwa

Product Version: UE 4.20
Tags:
more ▼

asked Oct 19 '18 at 06:06 PM in Blueprint Scripting

avatar image

Tanaka_Miwa
14 1 1 1

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

1 answer: sort voted first

Couple of ways come to mind:

  1. Instead of Applying Damage right away, you could check whether the Reflection effect is on, and then just have the Apply Damage be called once, on the pawn it's being reflected back to.

  2. OR, the Reflection effect damager actor can, when spawned, have a variable set ReflectDamageToActor and set that variable to the only actor who should get damage, and have it Apply Damage to that one. You'll know who to set ReflectDamageToActor to, because it will be the original damage causer.

more ▼

answered Oct 19 '18 at 06:14 PM

avatar image

mightyenigma
3.8k 18 23 20

avatar image ThompsonN13 Oct 19 '18 at 09:25 PM

below is an example that could work for you. here anytime damage is applied to the character it first checks to see if it should reflect the damage, if true then it simply applies damage to the damage causer. this setup may require a bit of tweaking for grenades for instance since you dont want the damage to reflect to the grenade but rather to the person that threw it. so using the instigator may be a better choice depending on the situation.

alt text

capture.png (136.8 kB)
(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