So i finally tested a blueprint interface in a test project and got it to work. Then i tried to implement it into my actual project but the event won’t fire off for some reason.
I have the Initiate function in the Interface. In third person character BP i have it implemented and when i press 3 , it calls or triggers or whatever the initiate function. In my other BP_BaseCharacter i use for npcs and stuff i put the event Initiate, followed by a function i use for getting their Initiative from them and printing string of their initiative number. It already runs this function on start which works, but when i press 3 it doesnt trigger the function again.
From what I can tell, your BP_Character (the one with Event Initiate) inherits from Actor, and your BP_ThirdPersonCharacter inherits from Character (the engine class) and not BP_Character. So they’re essentially unrelated and calling Initiate on BP_ThirdPersonCharacter will not trigger the code from BP_Character, unless I’m missing something in the video (kinda hard to see with all the names shortened in the tab titles).
If I had to guess, I’d say you forgot to reparent BP_ThirdPersonCharacter to BP_Character. Or maybe your “3” code is supposed to be in BP_Character instead. Hard to say what you intended here, but hope this clears things up a bit.
thank you for the reply! Basically at event start its printing the “Initiative” roll for the 4 BP_Characters on the map. But i want it so when i press 3 as the 3rdpersoncharacter, i want to it do the “InitiativeRoll” Function again and print it again. but it doesnt do that. You are right that the 3rdPersonCharacter is not linked at all to BP_Character but that’s what i thought the interface was for? so it could communicate to the BP_character that it wants to run that event. They all have the interface implemented but it doesnt seem to go off at all.
We could describe an interface as “a promise of some functionality”. So, if your class BP_ThirdPersonCharacter declares itself to be using the BPI_Initiative interface, it “promises” it will implement the functions that interface declares, which is just the Initiate function in your case.
From the video it seems like your BP_ThirdPersonCharacter calls Initiate on itself, so, what will happen is its own Initiate implementation will run, and that implementation (based on the video) doesn’t exist, so nothing will happen.
Here are some more guesses what might’ve went wrong between the idea and the execution:
Is BP_ThirdPersonCharacter missing an implementation for the Initiate function? If not, it’s not supposed to have the Initiative interface either, because that’s what the interface is for.
If you planned to call Initiate on some other character (of type BP_Character), you need to pass it as the parameter to Initiate (see image), because otherwise it defaults to the current blueprint (see Target = self).