Death error

I copied the inventory from “inventory UI with UMG” following a video… everything seems to be ok but if i reload the level i get an error linked to energy value.

This is how i reload the level if health value reaches 0:

And that’s the error I get anytime i die (when i close the game):

What could cause this error?

Hello ,

From the information provided it looks like your function is looking for your character which from the error I am assuming has been destroyed. You could try using an “isValid” node to check and make sure that the character is null before calling the function. If this is not the case, I have a few questions for you that will help narrow down what issue it is that you are experiencing.

Quick questions:

  1. Can you reproduce this in a clean project?
  2. If so, could you provide a detailed list of steps in order to reproduce this issue on our end?
  3. Could you provide a screen shot of where the function in actually being called?

How and where should i put that isValid node? Should i destroy the player character before opening the level?

Hello ,

Without more information and without more screen shots of your blueprints, I will not be able to tell you where exactly you should try an isValid node. However, you will probably need to place it before calling the Get Percent 1 function. Please be sure to answer the other questions in my first reply if this solution does not work for your issue.

Example:

Make it a great day

This is where i use this function:

I just use it to set an energy progress bar in a widget.
It is too long to reproduce it in an empty project but i can link you exactly what i have done becouse i copied step by step these video tutorials:

Hello ,

Would it be possible for you to send me a copy of your project so that I can take a closer look?

https://drive.google.com/open?id=0BwmPd-rNtaDNfnY1T1FzM3pnbXA3ZjRLYkZGQVpsWWo1T2dITWs5UzYwOThFcjMzcXoxVlU&authuser=0

Here it is… Simply load “Livello_1” level inside “Livelli” folder, click play and go forward with the character… entering the triggerbox will damage and kill you. This should bring to the error i get.

Hello ,

I was unable to access your project via the link that you provided. Could you change the privacy setting for the link so that I can access it? I have provided an example below.

Example:

45387-googledrivelinksharingoptions.png

https://drive.google.com/folderview?id=0BwmPd-rNtaDNfnY1T1FzM3pnbXA3ZjRLYkZGQVpsWWo1T2dITWs5UzYwOThFcjMzcXoxVlU&usp=sharing

This should work

Hello ,

Could you please zip down the project and resubmit it? In it’s current form I would need to download each file individually.

https://drive.google.com/file/d/0BwmPd-rNtaDNYk1NcGZ5d2FFSk0/view?usp=sharing

Hello ,

After looking over your project I found that you were not cleaning up your old widgets after destroying your player. This left a widget on screen with nothing to reference. This is what was causing the access none errors. What I did to fix this was to add a “Get all Widgets Of Class” node (using the UserWidget base class) and ran that into a ForEachLoop that removed all of the widgets from parent. Once the loop body was complete I created the widget as normal. I have provided an example below. I hope that this information helps.

Make it a great day

Thanks it was exactly that!!!