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"

Stopping damage from a trigger volume

alt text

Hey, I'm trying to cause damage to the third person character. I have managed to get the trigger volume to cause damage infinitely whilst I am in it, I just need it to stop once I am out. Please help and thanks in advance.

Product Version: UE 4.15
Tags:
helpme.png (67.7 kB)
more ▼

asked Jan 20 '18 at 11:17 AM in Using UE4

avatar image

Ganondork01
10 1 3

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

1 answer: sort voted first

Your problem is that you have a loop continuously applying the damage and, once started, there is no way to stop it. You need to change your approach.

For example, create a bApplyDamage boolean variable. Set its initial value to False.

From Event ActorBeginOverlap call a DoOnce, from it set the bApplyDamage variable to True, then call a WhileLoop that applies the damage and has a Delay at the end (like you did in yours). The WhileLoop must be controlled by the bApplyDamage variable, so as long as that variable is True it will continue to loop and to apply the damage.

Now create also an Event ActorEndOverlap. This event should set the bApplyDamage variable to False, then connect to the Reset Pin of the DoOnce.

In this way, when you exit the Trigger volume, you stop applying the damage and reset the DoOnce in case the player would enter the same trigger volume again.

Give it a try and ask again here should you encounter any issue.

more ▼

answered Jan 20 '18 at 12:26 PM

avatar image

vr_marco
2.2k 10 6 12

avatar image Ganondork01 Jan 20 '18 at 01:53 PM

Thanks, I think I have a starting point from here, but I'm still within the early stages of learning Unreal, so I still get confused easily. Where do I go from here?alt text

avatar image vr_marco Jan 20 '18 at 01:59 PM

Looking pretty good, but it needs some fixes.

Event ActorBeginOverlap

Remove the ApplyDamage from the Start Closed of the Do Once, you don't need it there. Start Closed should be unchecked.

After the DoOnce you need to set bApplyDamage to True, otherwise the WhileLoop will never be executed.

Add a Delay after the SET Max Health otherwise it will kill all your health very very quickly.

Event ActorEndOverlap

Remove the DoOnce, you don't need it there

Out of the event execution pin, SET bApplyDamage to False. Then connect the output execution pin of the SET to the Reset input pin of the DoOnce attached to the Event ActorBeginOverlap

(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