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"

Updating HUD on pawn

I need help with updating variables from a pawn to the hud. Basically instead of using the first person template I created a brand new project using a pawn and a static mesh as the main character. I am trying to update the hud with information such as battery life remaining however I can not get the reference to the pawn correct. alt text

This is my current set up for getting the battery level from the bot character and putting it into the progress bar on the hud

alt text

This is how I am creating a variable with the object reference to the bot so I can get the battery level from it.

alt text

and lastly here is the error I get when you run the game.

I'm not new to unreal engine however this is the 1st time I have started a project from scratch, with the character template I know how to do this but because the nature of the character I am using I need to start from scratch. Any help would be greatly appreciated and if you need any more information/ screenshots just let me know and I will send it right away. Thanks in advance.

Product Version: UE 4.9
Tags:
ingame hud.jpg (333.0 kB)
bot reference.jpg (213.3 kB)
error.jpg (283.7 kB)
more ▼

asked Sep 20 '15 at 09:39 PM in Blueprint Scripting

avatar image

thecoweggroll
1 2 3

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

1 answer: sort voted first

Do you assign anything to your Bot variable? A reference variable points to the place in memory where an object is stored, and by default it is not set. To do so you can go to you HUD even graph, add an event "Construct" node, get the owning player pawn, cast it your Bot class, and then assign the result to you Bot variable.

more ▼

answered Sep 20 '15 at 09:47 PM

avatar image

Fluppi393
457 36 33 54

avatar image thecoweggroll Sep 20 '15 at 10:03 PM

Thank you for the help, its works perfectly now. It has always been the communication between blueprints that confused me. If anyone else in the future needs help with this issue I will send a picture of the blueprints. alt text

fix.jpg (347.7 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