Cast node help

I am casting to my character in the EnemyHUD so that I can get his health but I don’t know what to use as the object.

Try to get the owner of the HUD and put that in the object.

Try putting the owner of the HUD in as the object. I am quite sure the is a node to get the ower of the HUD.

Than. You van cast from the character to the hud with get hud. or create An interface.

On Mobile. Sorry for typos

I couldn’t find a node that gets the owner of the HUD

The casting works but now the enemy health is apparently 0, Screenshot - 2dc39f7c52cac827fdf081ce270966d8 - Gyazo

Even though I set the health to be 100.

I don’t see any output on your first picture. Where should it be?

The gray progress bar above the red cube is the enemy health. It should be red as he has 100 health.

you need variable enemy character for cast
look lesson in video tutorialdocs.unrealengine.com/latest/INT/Videos/PLZlv_N0_O1gb5sdygbSiEU7hb0eomNLdq/1pmPb_TWG-8/index.html

Hi ElectricNic89,

The way casting works is you get a reference to an object, then check if that object is of a specific type. In this case, you will need to pass a reference of your AI to the character and then cast to the AI class you need. Once you have done this, you’ll be able to use other assets. You can find more information on Casting here:

https://docs.unrealengine.com/latest/INT/Engine/Blueprints/UserGuide/CastNodes/

Additionally, we have a video where Zak Parrish goes over various types of blueprint communication and how to use them:

https://docs.unrealengine.com/latest/INT/Videos/PLZlv_N0_O1gYuWkyTSbfcuyPNOQsK_8bu/EM_HYqQdToE/index.html

My casting works but the other problem I’m having is this:

The casting works but now the enemy health is apparently 0, Screenshot - 2dc39f7c52cac827fdf081ce270966d8 - Gyazo

Even though I set the health to be 100. Screenshot - 55ddf850a6eada5afc654cfb665d6d4b - Gyazo

The gray progress bar above the red cube is the enemy health. It should be red as he has 100 health.

грубо говоря твой каст идет по линии провала(cast fail), если каст провален то он не сможет взять переменные из этого класса
roughly speaking your cast is on the failure of the line (cast fail), if caste is failed then he would not be able to take the variables of this class

But when I don’t use the cast failed then I compile it it gives me this message ‘Note’

look tutorial video on twin stick shooter there talk about what you want

enemy spawn on level?

I only have one enemy in my level which I placed in. They don’t spawn randomly yet.

вообщем тебе надо зделать эту переменную доступной( на глазок нажать). после на уровне взять пипетку и выбрать класс откуда ты берешь cast

in general you need to create one this variable available (click on the eye). after level and choose pipette to take a class where you take a cast

I’m not using a colour box. I have a widget component inside of my enemy.

color box it my project, with I work now.
okey. casting works like this: you create a variable in it indicate basisenemoreferentse made it available, there was a yellow eye icon is now at the level you take this class you look at its settings there basisenemoref pipette and pipette take in and poke the class that you want to associate casting