I'm learning how Blueprints communicate with Unreal engine (5.3) but having troubles getting my blueprints to communicate with a Interface, I think i have set this up wrong? perhaps its something i missed. I simply cannot call the data from the Component.
I'm trying to get the Location data from the Projectile Blueprint to a Actor Component. This is for a grappling hook.
I have a 3rd person character in that a Input that spawns and fires the projectile, in the projectile actor i have it set up so when it hits or collides with anything it fires off an event, getting hit and makes transform and setting it a variable.
I have a interface called Game data, and function called Grapplehook Info with a input for GH_Hitlocation, I have added the interface through the class settings to both the Projectile and the Actor component
it seems it wont call the function in the Actor Component? Image of a the 3 BP's attached
I expected that once i called in the Interface BP i could just pass the info through the call event in the other Blueprint and it was all fine, but it seems when the data tries to pass i just simply doesnt.
I had issues where the Actor componet was telling me that i could not use the event as it was a duplicate name event. but when i dragged the pin from the interface it was just a set node for input not output which i needed, I checked the advance boxes playing with Const, Exc, and ect what worked so far in getting rid of the dup name was call in editor check.
It seems you have some fundamental misunderstanding of what Interfaces are (especially in Unreal) and how to pass data from one Object (your
ProjectileBlueprint) to an Actor Component (GrapplingComponent) where the Actor Component is attached to an Actor (which you have made no mention of).The only way for your
Grapple Infointerface function to be called onGrapplinComponentis by invoking theGrapply Infointerface function on the component. And you can only do that if you have a reference to the component itself (either directly, or through theActorComponentbase class). There are not some sort of a global event that is caught by every object that implements said interface.In the screenshot, I have pointed out the pin that you are missing. This pin, for interface functions, is
DefaultToSelfin Unreal but that's not always what you want. This pin must instead be conneted to the Actor Component.In fact, you can even see on your interface function call, it says Target is Grappling Hook Projectile BP.
Moreover, interface functions should generally be called through their
Messagevariant. For example, the following screenshot shows the interface callMy Functionas a message (envelope icon)To sum up:
Projectile_BPorProjectile_BPneeds to be able to get the reference somehowProjectile_BPby connecting the above mentioned pin to the component reference