Why is my cast failing?

not much info here, blueprint looks ok but if I had to guess maybe the Object being passed into the Something method is not a Stats type or does not derive from Stats.

Hello, I am trying to make my “Something” function inside of “Plant”:

Tell the “YaBoi” event inside of “Stats” to activate.

However for some reason, the cast always fails, I have tried activating the event without the cast, however, it doesn’t activate and I am left scratching my head. If anyone has a solution for this, that would be amazing. Sadly, I need some rest, it’s 5am and I have spent five hours trying to fix this issue, to no avail.

what is the Object you are passing into to the Something method?
it either needs to be of Stats type or has to be based on the Stats type (inherited from Stats).

How would I make it derive from stats

Now I am getting an error: “Object” is already a “Stats” you don’t need a K2node_dynamic_cast3

I removed it and now the event will not activate. The string that says “sadsadsadsadAAAAAAA” prints however, it’s weird.

Remove the cast :wink:

Where are you firing the Something function from? And are you definitely passing in a reference to a Stats actor when you do?

Where are you firing the Something function from? And are you definitely passing in a reference to a Stats actor when you do?

“Stats” is a UMG, the Something function is located in the “Plant” UMG

well that doesn’t answer the question to where are you calling the Somthing function from and what is that (yaboi_Event) event?
is the UMG displaying correctly?
is it added to the viewport?

Yeah but how are you firing this function? Some event should be triggering the Something function and when it does, it needs to pass in some kind of reference.

I am firing from the “plant” UMG, “something” is in that UMG, and yes

Well there’s your problem, you are passing in “Self” from within “Plant” so you are passing in a “self” reference “plant type”, you need to get and pass in the “Stats” UMG reference.

how would I get “stats”

NEVERMIND, I GOT IT, THANKS FOR THE HELP, this setup works for anyone else having the same issue