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"

Health System not working with UMG

So I have a question... Is it because the float isn't right? Or how the event in the FirstPersonGameMode is?

alt text

Product Version: UE 4.9
Tags:
part1.png (88.9 kB)
part3.png (86.6 kB)
part1.png (115.0 kB)
more ▼

asked Feb 10 '16 at 02:49 AM in Blueprint Scripting

avatar image

LeasterBeaster
25 3 3 8

avatar image Kontur Feb 10 '16 at 06:03 PM

Hi there,

Could you please specify your issue a bit more I am not even sure about your problem. What exactly are you trying to achieve?

avatar image LeasterBeaster Feb 11 '16 at 02:14 AM

Basically kill the player when the health is at zero. then get the player start's transform and spawn there, like in the one in the documentation.

avatar image Kontur Feb 11 '16 at 02:22 AM

Where do you call your 'Death Event' function? Also may I ask whats the purpose of checking the Current Health in there? Shouldn't you call the 'Death Event' after you checked the health of the player and it is 0?

avatar image LeasterBeaster Feb 11 '16 at 02:29 AM

Hmm, never thought of it, let me try.

avatar image LeasterBeaster Feb 11 '16 at 02:33 AM

Wait do I put in the death event then call it in the player blueprint, or do I put the death event in the game mode.

avatar image Kontur Feb 11 '16 at 02:32 AM

Okay, just get back here if you can't get it to work I'll try to help you out.

avatar image LeasterBeaster Feb 11 '16 at 02:40 AM

Did you get my last comment?

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

2 answers: sort voted first

First, I don't get that 'CallDamageEvent' node. Is that some built in thingy? Anyway, I still do not see that you check if your health is not 0 (not in the Death event, thats not the right place for it). I think you should think about it in logical steps.

Basically you want to deal some damage to the Player, check if he still has health after the damage, if not, call Death Event. In there, you setup the respawn system (what you've already done as it seems).

It looks like that you pretty much have your system already setup, you just need to finish the puzzle and connect them in the right order.

more ▼

answered Feb 11 '16 at 03:34 AM

avatar image

Kontur
186 6 10 15

avatar image LeasterBeaster Feb 11 '16 at 03:45 AM

Well that makes more sense, anyways I'll will figure out what is causing the issue, but yeah thanks for trying to help!

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

I think you should do something like this:

-Set up a system that deals damage to the player (a volume would be perfect for testing purposes) -When you deal damage to the player (eg. -10HP) after you subtracted the damage from the Current Health variable, you want to check if it is greater than 0. You can use a branch node here, if it is greater than 0 you do nothing, if not, you call the 'Death Event'. (The setup of your respawning system seems fine at first look).

Are you familiar with Casting or Blueprint Interfaces? Most likely you will need to use one of these metholds in order to communicate between your Blueprints.

more ▼

answered Feb 11 '16 at 02:40 AM

avatar image

Kontur
186 6 10 15

avatar image LeasterBeaster Feb 11 '16 at 02:43 AM

Okay, thanks.

avatar image Kontur Feb 11 '16 at 02:45 AM

I didn't see your last question, I would put the Death Event in the Character Blueprint.

avatar image LeasterBeaster Feb 11 '16 at 02:57 AM

ok so would it look like this?alt text

cap.png (80.0 kB)
avatar image LeasterBeaster Feb 11 '16 at 02:57 AM

This is on the game mode.

avatar image Kontur Feb 11 '16 at 03:01 AM

It doesn't look right, you are calling the Death Event right after you Posses your Pawn. Also, please upload a screenshot for each of oyur Blueprints where I can see the nodes together.

avatar image LeasterBeaster Feb 11 '16 at 03:08 AM

Of the death event or the health?

avatar image Kontur Feb 11 '16 at 03:03 AM

The Death Event function should be called after a set of nodes that checks the health of the player. What deals the damage to your player?

avatar image LeasterBeaster Feb 11 '16 at 03:10 AM

A simple cube that rotates, just for prototyping.alt text

capture.png (115.6 kB)
part 1.png (112.4 kB)
(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