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"

My HUD works on my player char, but not when i posses cars

Hello,

I have created a HUD with health, armor and a clock. It works great on my playercharacter. However, when i enter a car (posses a car pawn) my HUD dissapears. My actor is hidden, not destroyed whilst i am controlling the car pawn. And my HUD is set as the default HUD.

I think it is due to me not being able to get a playerchar health reference when i cast to the cars, but i also fail to do it with the clock, i have tried for hours and with videos but i can't seem to figure it out.

I would like to find a way to keep my HUD (health/armor/clock) exactly as it is on the screen when i posses/enter a car like when my character is on foot. Is there any way to do this?

thanks in advance!

Product Version: UE 4.21
Tags:
more ▼

asked Dec 09 '18 at 10:02 PM in Blueprint Scripting

avatar image

Lucio.R
1 1 2

avatar image Lucio.R Dec 10 '18 at 10:38 PM

Update: Any static HUD elements will stay when i control the car, but not the functions.

The blueprints to get the health/armor/time numbers into the HUD work through my main pawn,(PlayerChar_Master)this is the character with the actual health/armor. I still can't figure out how to keep my HUD the same when i change possession (to the car).

When i get back to possessing my main pawn(when leaving the car) the health/armor/time numbers are all correct. I just cannot get them to display while possessing the car.

avatar image Nebula Games Inc Dec 11 '18 at 12:00 AM

Seems like an issue with how the function is gathering the "health/armor" info. For example if the function gets a reference to "Player Char Master" and that BP has "health" variables and "armor" variables then the function utilizes those to update things on the HUD. However, if you now possess a separate BP character say "Car Pawn" and this is NOT a child of your player character master then the variables in the Player BP will not directly transfer to the Car pawn. So if you have a HUD that needs to work for BOTH you need to make sure EVERY single variable within those functions has a proper reference no matter if you are possessing a car or the player character. Alternatively you could store the variables in the player controller that will allow you to take all that data with you when you possess different pawns.

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

1 answer: sort voted first

Edit: OK its not the player controller, but if you store anything in your player character ( like the third person char ) it will disapear when possessing, so i will try to make everything in the player controller and see if it work...

more ▼

answered May 23 '19 at 06:46 PM

avatar image

Samuel Brunner
1 1 2

(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