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"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

How to reduce stamina when player enters a box ?

Hi folks

I am planning to have something like a poison gas surrounding a mesh. So i created a box and have it as a child of the mesh.

I then setup the onbeginoverlap and the necessary nodes but it does not work. Already have the overlap settings in the box and mesh to true. It is the same graph i used on an object but when i tried the graph on an object, the overlap works.

So anyone can help me or maybe give me an example of a simple graph where the player enter the box with gas, has his stamina reduced the longer he stays there.

Thank you

Product Version: UE 4.8
Tags:
more ▼

asked Sep 22 '15 at 04:10 PM in Blueprint Scripting

avatar image

ENRELL
1 1 2 4

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

2 answers: sort voted first

Hi man , on begin overlap , its an event that occur just one time, when you enter the trigger. once you are in there the event does not fire enymore, unitl you exit, then he cast, on end overlap.

There are several ways to to this , that all occur to different problem , here a working example, you can set a variable to the char/enemy/player who enter in the trigger, using the cast to method. So in the Char/enemy/player you can check at every thick , if you are in the damage area. if yes , you just detract the right damage of life, or stamina in your case.

Its pretty simple, you can also create a custom event, like, FIREevent or FOG event. that check your variable , and then reduce your life , your breath or your stamina. alt text

damage.jpg (327.5 kB)
more ▼

answered Sep 22 '15 at 05:21 PM

avatar image

Est_engine
1.2k 58 12 62

avatar image ENRELL Sep 24 '15 at 08:16 AM

Thank you so much for the prompt reply.

Let me give it a try.

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

Basically, add a Collision Component to your gas cloud object. Also add a variable to keep track of which character is currently inside the cloud. When the player enters the cloud, set the variable to the player. When he leaves, reset it to None.

alt text

In the event tick, if there's currently a valid target in the cloud, reduce their stamina.

alt text

Should it ever be possible for more than one target to be affected by the cloud, you could also keep track of a list of targets.

alt text alt text

more ▼

answered Sep 22 '15 at 06:12 PM

avatar image

erinacea
1.8k 69 28 113

avatar image ENRELL Sep 24 '15 at 08:15 AM

Thank you for the kind reply.

I have gotten it to work on a player one time if he stays in the cloud, but not continously in the gas.

Seems like i cant use Cast To PlayerController node as i had a string trigged when casting failed.

Can you suggest other nodes to use ?

avatar image erinacea Sep 24 '15 at 10:13 AM

What Cast to PlayerController node? I didn't use the controller in my solution. You need to cast to your character Blueprint because only actors of that time will have stamina that can be reduced.

(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