Interface event not firing

So, after a long while of using Unity, I finally decided to learn Unreal.

Blueprints are confusing, but just when I thought I got the hang of it I tried making an interactable gameobject.

Desired output: Event of BP_IInteractable gets fired
Current output: Event does not get fired.

Blueprints:
Player -
image

Interactable test object -

The interactable test object extends from BP_IInteractable.
The BP_Interactable_Test is attached to an actor (A sphere).
I am sure that the correct actor is stored in the collision check; On use, the breakpoint shows the detected item being a sphere.

However, none of the nodes in the event hit. What’s going wrong?

In other questions I saw often the reference going wrong, but that’s not the problem; the correct object is referenced. It is an event (red dot), it is calling an event message (envelope icon thing), its just not doing ■■■■.

(Notes: Yes, I will implement a better system for which object to interact with. This is just the absolute basics, to check if I can even get an OnInteract event to fire. Which well, I can’t.)

Thanks in advance!

i think you forgot implement the interface in the class setting of your interactable object :face_in_clouds:

Well, in the ‘interfaces’ tab I did add the required interface. Do i need to do more than that?

In the event node you can see it says ‘From BP_IInteractable’ so

the other thing is when u set the interactable game object, pick a other actor, in that case is better put a “does implement interface node” with a “branch” after the hit

or maybe you dont generate hit events in your collision or is false in the settings

That’s not the problem. Everything in the player class executes fine, the variable gets set, the input gets called, etc. The event ‘message’ just doesn’t arrive.

The only reasons why the message is not sent are those mentioned above.

  1. You don’t implement the interface
  2. The actor’s reference is wrong
  3. on Hit event don’t trigger

There is no other way for it not to work, the only thing I can think of is to put a print before the Add Force in case it were a character configuration issue.

Okay so i tried to do some debugging, but it seems like the actor that does have the blueprint as it’s component still fails to cast to an instance of the blueprint. Almost like the game is ignoring the fact that the blueprint is assigned to the object. The hit event triggers, the interface is implemented, and the actors reference points to the correct actor… However it seems like the actor’s component holding the blueprint is ignored. What am I doing wrong?

I tried assigning that exact actor to the variable in editor, but it doesn’t allow me to because it is not a candidate, even though the actor definitely has the blueprint assigned to it.

So I found the solution… Apparently, unlike in unity, not all blueprints are always a component. My blueprint was an actor component that I added into a sphere, so it became a child object of it. I assumed that it was a component, but this was not the case. Converting the interactable to a component fixed it.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.