Casting Node Input

I have this blueprint, which doesnt work, but i dont see why (I want to target a mob with Leftclick and then do damage to it with F button).
My main problem is that i do not get what to plug into Object input of a Cast node and how exactly. can someone explain it on a simple example, like im a toddler, of what you put there, and why you cant do it like i did it? ill attach the blueprint that doesnt work, aswell as blueprint of Mob1 which im casting to…
Also, is casting more like “applying” (cast a spell) or more like “requesting”(cast a fishline)?
P.S. Also i dont get why you should plug Player Controller into Get Hit Result Under Cursor… its strange to me, but thats secondary.

Casting works by taking an object and accessing a specific class that derives from it.

For example:
Most actors derive from the AActor class. This means any objects derived from AActor can be cast to other AActor types.

What type is “Target” and what type is “Mob1”?

Just to check I am reading your question right, it is the cast from Target to Mob1 that is failing?

This series should help you. Check out video #1 and #25. Should help you figure this out

This is one of the most straightforward explanations about casting that I’ve come across: “A really good way i had this explained to me was to think of casting as “treat as”.” You can read more about it here: Casting explained?

Basically, in your case, it would mean that you’re trying to take the target object and treat it as a Mob1 object. If the target is an object of class Mob1 or a child class derived from it, then the cast will return true and you can then use the variables and functions of Mob1.

As for the player controller being required for getting hit result under cursor, think of it as a way of identifying which player’s cursor is to be used.

Thank you, that fixed every problem that i had! =)