I got a custom C++ class called “Life” wich controls the players life. Now I also have a Blueprint Actor called “Deathzone” and when the player touches that he loses a life.
So I thought I could just call the function “decrease life” on overlap. However when I add the function to the Event Graph it says “Blueprint target “self” is not compatible with Life”… But how would I go on about that?
You need to connect the instance of your Life class to the “decrease life” function in the blueprint event graph. What is the base class of Life? Is it an ActorComponent? If so, you should have a reference to it in your actor.
I assume the event graph you described is inside the Deathzone class? Then you could do something like GetComponentByClass on the overlapping actor to get the Life component.
Yea i figgured id need a reference to the Life Class. The Life class was an completely Empty base class. The problem is that I never worked with unreal before…