How make reference between node Cast To and Return Node?

Hey @TITANOVTZAR!

You just drag the blue output pin of the Cast To node into the inner area of the Return node (not over a pin, but over the black area until it says “Add Pin to Node”), or you can also select the Return node (or the function), navigate to the Details window on the right, and add / remove params there. But I don’t think that’s really a necessary function.

Hope this helps :innocent:

1 Like

Thanks for the answer and explanation of the possibility of direct connection of nodes! Unfortunately, this is not exactly what I need. The thing is that I am studying UE5 from a book and it requires direct connection of these pins. I made a photo of a screenshot from the book for you for better understanding.

Oh I see where the confusion is. So that’s not a conversion node between the output pin of your Cast To node and the Return Value. That float type variable named “Health” there is a variable created in your “ControllerUI”. Here, you’re accessing it using the Cast To node and setting it as the return value of your function.

For you to be able to replicate this, first you need to have the float type “Health” variable in your “ControllerUI”. If you don’t have it already, you can create new variables by navigating to the My Blueprint window on the bottom left, and hitting the plus (+) icon next to the Variables section. To change its type, you can either directly click on the type name next to the variable name and select your desired type from the dropdown menu, or navigate to the Details window while the variable is selected and do the same from the dropdown menu next to the Variable Type property.

Once that’s done, you can simply drag that blue output pin of your Cast To node, release it on an empty space on the Event Graph, and search for your variable’s name on the menu that pops up.

Hope this helps! :blush:

1 Like