Disclaimer: I’m new to UE4 (and programming) and now using 4.4
At first, I’ve been able to work fairly easily with BP Interfaces. I assigned the interface to each blueprint involved and then call the event(s) or the function(s) so far so good BUT I keep failing at transmitting a variable using a BPI (Inputs - Output).
I’ve been looking into Tutorials, I’ve checked the Example on the marketplace, tried to use the most basic set-up (assign a default value to the variable on one side and just try to do a print string on the other side) but no matter what I get 0 when I try to read the Output.
The variable Time is correctly updated (checked using a print string in the vent graph) but nothing comes out like I’m unable to assign the value into the BPI
I found a workaround by putting my variable calculation into the BP gamemode and then from the BP HUD using a “get gamemode” to ultimately get my variable.
Very efficient and simple but obviously I feel very stupid not being able to get the BPI works as it should ^^
Make sure you have set a value to the variable ‘Time’ in your caster class at some point before you call ‘Race Time’ on it. Otherwise it will return the default value for this variable…which I am assuming is Zero.
I see that you are calling the function on PlayerCharacter directly. Try casting your PlayerCharacter to ‘TriggerRace’ and call the function ‘Race Time’ on the casted object.
PS: However if the ‘Race Time’ function is supposed to return the time sicne the race started, I think it is best put inside GameMode class instead of the Character class. So I think your current solution is the right way to go.