So not quite sure what all I might need to help get an answer, and sorry for the bad pics best I can do. I have a widget bp and a pawn bp , I have a bp interface for “spawn unit” and a “spawn unit preview” function inside my pawn. On test I get a print string(I deleted that off in the pic) after button press - calling the spawn unit in my widget, but nothing happens inside my pawn bp , am I missing something simple here?
- What happened to screenshots?
- Make sure the spawned actor isn’t below the ground by increasing the z axis of the transform location.
- Check if those branch nodes’s empty pins gets executed instead of the expected ones, also check if those executions in between gets triggered as well.
Try these out and see if you can gather any more clues
1: I asked qesutions on discord twice and the only response I got was “learn how to take pictures” I took pics of my screen with my phone and I’m using that for here also since I don’t have Wi-Fi, lol?
2: didn’t try that which I didn’t think would have been the issue atm (I tried no change)
3: through a print string on those quick, no change
It’s firing in the buy widget (on pressed->spawn unit interface node) nothings firing after that in the pawn blueprint though, I imagine there’s some disconnection between the 2 but I can’t seem to find what it is.
Sorry I didn’t mean to criticise you, I just didn’t understand why you would send photos instead of screenshots. Is your PC unable to connect to Wi-Fi though? How are you even able to show up here with no internet?
Anyways, I think it has something to do with that target pin then. If you’re unsure what to plug in there, you can just use the Get All Actors of Class node, select the blueprint where the code in your third image is included from the dropdown menu inside that node, drag a Get node out of the node’s Out Actors pin, keep the Get node’s index at 0 and plug it into the target pin of the node that you say doesn’t get triggered.
Where is Spawn Unit function implemented? It’s target says self, so I assume it’s on BP_PlayerOneHudTest ?
If it’s implemented in the HUD, you need to call the interface function on the HUD, instead of Player Pawn
You can get the HUD from the Player Controller.
Get Player Controller → Get HUD
This is all assuming BP_PlayerOneHudTest is a child of the HUD class and is set as the HUD in your Game Mode
It’s basic LTE connection on my phone, Imagine trying to make a game like this
Sorry my naming may be a bit confusing, the playeronehudtest is a pawn blueprint, it’s essentially just a flying camera, that’s where the event spawn unit is being called
Oh, in that case, ignore everything from my previous post.
Could you confirm that the Interface function in the Pawn is getting called by adding a Print String
I’m sorry what Was that supposed to mean bad
Like I’ve explained, try using the Get All Actors of Class node, because it seems like the issue is about that target pin being assigned incorrectly. Of course the target shouldn’t be assigned to self if the code in your second image is under a different blueprint than the one in your third image.
The button pressed is in a “buy menu” widget, which is inside my “main hud” widget
No nothing is firing for it in the pawn blueprint, why I think there’s a disconnect somewhere between it firing the button pressed-> spawn unit message (which I had a print string showing that’s firing) in the widget np but then nothing in the pawn blueprint, so the event spawn unit from bpi player isn’t firing, if that’s what you were asking
I would put a print string at the end of the OnPressed event to check the display name of the pawn that is being returned from GetOwningPlayerPawn. If it is returning the expected pawn i’d delete all the interface related nodes, save, and then add them again. Havn’t seen it happen in awhile but they could get buggy in past versions if you changed certain things.
I’m obviously a complete noob at this so sorry if it’s hard for me to even ask the right questions about what’s wrong lol, at least I know I look like an idiot
Did you try this?
Ok, we’re eliminating possible issues.
Next, lets check if GetOwningPlayerPawn is returning the correct Pawn. Did you give the Widget an owner when creating it?
Could you swap out GetOwningPlayerPawn with GetPlayerPawn instead and see if that fixes it.
Not yet I will try that I need to take a break for now and I’m probably running out of reply’s for the day, 7 hours and only got the hide show part working -_- , thanks for the help everyone I’ll try more later and update
Ok I lied, I rolled and smoked cigarette had an idea and tried it, I recreated the function from the pawn bp inside my buy menu widget, it works, but not exactly what I need unless I can think of a workaround, but the question is still why isn’t it going through to the pawn bp (still haven’t tried the get all actors of class yet)
Now I’m taking a break, thanks again
Probably because Get Owning Pawn owner is returning nothing. Try Get Player Pawn instead
If GetOwningPlayerPawn is returning nothing then the player controller assigned to that widget isn’t possessing anything. When you create a widget you assign the player controller, the GetOwningPlayerPawn node returns whatever pawn is being possessed by the owning player controller.
Ok, so I tried switching to the get player pawn, that didn’t work, as for Vis Ag, I’m not understanding what your trying to have me do , I can’t connect an out actor to a self object reference?
To clarify again ,In the pawn bp (playerhudonehudtest) the Event Spawn Unit is being called from an interface, “From BPI_Player” the Spawn Unit Preview it’s connecting to is the function created in the pawn bp, the widget with the on presssed connecting to the Spawn Unit message “Target is BPI player” is in a widget (not shown) the not shown widget is created in the bp pawn blueprint, the bpi player is the interface blueprint with the function with the variables spawn index and coins etc.