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"

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.

Product Version: UE 4.21
more ▼

asked Feb 10 '19 at 11:08 AM in Blueprint Scripting

avatar image

6 2

avatar image ThompsonN13 Feb 10 '19 at 03:08 PM

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.

avatar image lionwar Feb 11 '19 at 04:08 AM

Hi ThompsonN13, 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. alt text

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.

alt text

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

alt text

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. alt text

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

01.jpg (60.2 kB)
02.jpg (66.1 kB)
03.jpg (86.1 kB)
04.jpg (53.8 kB)
(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

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.

more ▼

answered Feb 11 '19 at 06:08 AM

avatar image

Nebula Games Inc
5.4k 28 9 15

avatar image lionwar Feb 11 '19 at 08:25 AM

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

avatar image Nebula Games Inc Feb 11 '19 at 12:47 PM

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

avatar image lionwar Feb 11 '19 at 01:22 PM

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?

avatar image Nebula Games Inc Feb 11 '19 at 02:25 PM

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.

avatar image lionwar Feb 12 '19 at 01:49 AM

It worked perfectly. Thank you very much

avatar image Nebula Games Inc Feb 12 '19 at 01:59 AM

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

avatar image lionwar Feb 11 '19 at 02:41 PM

thank you so much, I'll do that and I'll let you know. Thank you again ;)

(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