hud problem

hi guys,
i am trying to build a HUD where i can press some buttons to switch between different camera positions for an archviz presentation.
how can i refer to the hitboxnames with the eventreceivehitboxclick.
i cant manage to get the names from the both hitboxes to appear, only case 0,1 etc.
and if i could manage this how can i adress the cameras from this blueprint.

thx in advance
stucki

no one can help ?

hey guys i am really stuck with this for days, i cant get it to work.
Is there no one who can help
kind regards
stucki

Hey,

so first of all let me ask a fairly basic question. Why not UMG? It’s super easy to setup and you just get events for each button, can set design, behavior and all that in an easy editor. I would recommend it.

However there may very well be a reason I don’t know which requires you to do it like this so let me try to help you here.

“Switch on Name” allows you in the details to set the possible name strings which will be chosen as they come up. This should already help you with the selection issue.

To address the cameras I’d suggest to just use again those names and a function in your player controller or character. I’m not entirely sure anymore which functions are available in HUD but there should be something like “Owning player controller” or similar. Like that you have an easy connection to that and can then go on to find your camera manager or some function in another part.

Hi Erasio,
thx for taking the time and helping me.
I am very new to unreal engine and i really missed the details section to add my own custom names.
i though ue4 should have picked the names itself because i named them with the draw hit box command.
now i see much clearer ! thx to you.
and i certanly will have a look at UMG, too
once again thank you

so now i got my hud buttons clickable !
but now i got the problem i cant adress the cameras from the hud-blueprint.
from level blueprint i can easily adress my cameras by selecting them and pressing right mouse button in the blueprint and create a reference to it.
why cant i do this from my hud-blueprint and how can i do it at all ?
thx in advance

wow thx again for helping, though i must admit i do not get the examples right now.
i have created three cameras in the editor and i want to change the camera by pressing the buttons of my hud. so now i understand i can adress them directly from level-blueprint but not from any other blueprint.
how can i reference a camera from the level blueprint so my hud blueprint can set it to my current camera ?

or could i create my hud from the level blueprint ? could this solve my problems ?

The thing is: in your level blueprint you can simply select actors currently inside the level as they are guaranteed there.

If you do it from your hud or character you will need the cameras as part of one of those blueprints so they are guaranteed available. So you have something to reference to and are not pointing to nothing.

You could do something like this:

Simply moving the camera. You could set up two cameras in the player character and swap between them. You could even just reference cameras via the level blueprint to a variable in your controller which you pass on to the camera manager.

It really depends on your needs.

You can read up here in how cameras work in this engine:

No. You can’t create an hud for your level. Whom would it belong to? To which player? That would be messy (well you can create a umg widget once you have a character controller reference).

What you could do is create a set amount of cameras. Add variables for them (ideally in your player character) and then toggle between them.

You can use the (camera) reference from your level BP to provide it to your character for example. This would allow you to do exactly the same like you did via the level BP but as a callable function which you can call from the hud.

You can use the (camera) reference from your level BP to provide it to your character for example. This would allow you to do exactly the same like you did via the level BP but as a callable function which you can call from the hud.

that sounds good. Sorry that i am such a noob. just started a few days ago with it.
can you please explain this detailed to me so i can rebuild this in my blueprints.
or even better if i may ask make a screenshot of the things i have to do ?
thx in advance
stucki
i am really trying to get into this, but its not that eas for me …

First you need to set up a few things in your controller. I used to get this together quickly the keys “1” and “2”. You will have to add your hud hitbox events instead.

I created an array of camera actors. If you know it’ll always be two you can also just create two variables but like this you could (theoretically) do stuff like creating a dynamic amount of cameras per level and create a button for each on so you’re not as limited.

Any way. You create that array. You can also directly set up the “Set View Target with Blend”. This basically just means change the camera.

In your level you will have to set up this “cameras” array like this:

Keep in mind that this is not a good way to do this. “Get controller” only really works in environments not using network or local multiplayer but I assume you will need neither.

The blend time defines how fast the camera view transitions between those two cameras. It will “move” from the one to the other rather than instantly change position if you don’t have 0 in there (which is the default).

Why not UMG?
Just as a general reply here, I recently went away from UMG back to primitive HUD drawing because UMG does not work properly with splitscreen. It’s not a full HUD replacement for all use cases.

A very good point indeed.

It does have it’s issues and isn’t the best solution for all cases. Not nearly all cases.

I still like to recommend it especially to people who appear to have not as much experience as even with all it’s flaws it still is a whole lot easier to work with.

oh my god i must be stupid but i am still not getting there.
i followed your screenshots and descriptions but still when i start the engine clicking my hud buttons does nothing at all.
i attached screenshots of both.
by the way how can my myplayercontroller blueprint know about the hitboxes created in myhud blueprint ? can there be the problem ?

once again thx so much for taking the time to help me !!

It can’t. And I would at this point strongly suggest to get someone with coding experience on board because that would make everything so much easier for you. There is so much even to blueprint scripting which requires at least moderate knowledge about programming and some basic principles.

Anyway no obviously your button hits can’t just know your controller. But your HUD knows your controller. You can instead of my key events use custom events and call those from your HUD via the “Get Owning Player Controller” node.

A custom event is simple an event which you can name and then call from anywhere which then will execute the code you defined but different from simple nodes you can call it from other classes as well.

https://docs.unrealengine.com/latest/INT/Engine/Blueprints/UserGuide/Events/Custom/index.html

thanks again for heloing me ! i will try to learn unreal engine 4 blueprinting from the start in the next time.
meanwhile i put some objects in the scene and use them as hud so i can control everything from the level blueprint and dont have to communicate between different blueprints. at this time this seems to much for my small mind :wink: