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?
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.
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.
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…