Keep the same HUD when possess a pawn

Hi Everyone,
I have a simple question.
How can I keep my same HUD ( thats work perfectly on my player character )
when I possess a pawn ?
My entire HUD disappear untill I repossess my main character.
The Pawn it’s a simple camera with a spring arm rotating around a mesh.

My game is simple FP graphic adventure, so my HUD it’s only a dot at the center of the screen which is fixed when you walk and it moves ( using the mouse position ) when you grab an object and put it on front at the camera so you can examine it.

Thank you to everyone in advance.

how are you creating the hud now? are you using the hud class? where are you creating the widget? how are things implemented?

the simplest answer i can think of would be to create the widget in a location not dependent on the class your possessing or use the hud class. either could work but without the details of what your doing its hard to actually answer you properly.

Hi , thank you for your answer.
I’m gonna try to give you more and specific detalis.

I created a HUD called “Crosshair”.
I added this HUD to my GAMEMODE ( hud class = Crosshair )

My hud is a simple dot at the centre of the screen it is fixed when I walk or look around.

When I grab an object to examine it, the hud position is controlled by mouse position.
I don’t possess the object I only enable input to rotate it and interact with it.

Then there is Pawn blue print which is a simple camera with a spring arm that rotate
around a custom mesh

But when I possess che Pawn and rotate the camera around using the ASDW keys
( so I can use the mouse for the Crosshair )
the HUD disapper.

I hope I gave you enough informations,
if you need more please let me know
Thank you very much again.

I would just create the HUD in the player controller (assuming you use the same controller for both main character and pawn) then it should stay in the viewport. You probably are creating the HUD in the main character and when you are no loner possessing that character the HUD is removed/not visible.

Thank you Nebula,
May I ask you how to do this?
Or can you link any page where this is explained?
I looked around for a bit with no resoult.
Thank you very much

When you create the HUD and add it to the view port, do it in the player controller. It’s that simple.

thank you for the tip,
But I can’t still create the event " EVENT RECEIVE DRAW HUD" in my player controller.
How can I do that?

So, I just assumed by HUD you meant a “UMG” widget. You can only use “Event Receive Draw HUD” in an actual HUD class. So my suggestion to you is, create your “dot/crosshair” as a UMG widget and things will be much simpler.

thank you so much, I’ll do that and I’ll let you know.
Thank you again :wink:

It worked perfectly.
Thank you very much

Cool, glad you got it working. Also, you don’t need to add a second answer (just confuses the thread)…:slight_smile: