Change character position from level blueprint or gamemode?

Right now I’m trying to make a roguelike, and when the player restarts I want it to move the character back to the beginning of the level and regenerate the level. The regeneration works fine, but for some reason the I can’t send the player back to the beginning from the level bluepring. I tried doing the exact same code in the game mode, but that didn’t work either. I’m calling a function inside the player that changes its position, it looks like this:

I don’t see why that just doesn’t work. I also have tried calling the despawn level function from the player, since I can call that function just fine if I bind it to a button just inside the player, but then it won’t call the level despawn function. It looks like this:



Does anyone know why it won’t call the functions like this, or what I should do instead?

Chef, it is hard to follow the blueprints when you don’t know what they are. Keeping the tabs visible at the top help with visually navigating through these questions. However, My suggestion would be to check if P and O are working by printing out a string when they are called. Then, if that works, print the string out for player and make sure that is set. Finally, there can be only one! so instead of setting a var for the game mode, just use “get game mode” so you know you got it.

Sorry about that, both were just in the event graph, the first one was in the game mode and the second was in the player blueprint. I know the button press is functioning, I did test it with a print like you said. The blueprints for some reason aren’t communicating though, I can’t call functions from one blueprint in another. That’s all I need to do, can someone just recommend a way to do that?

It shouldn’t be that hard, I just need to call a function in one blueprint from a different blueprint

I should have looked closer. Don’t set the capsule component location. Set actor location and the ref should be self in the player bp. that should reset the player location. You may actually just be moving the capsule component right now.

When I call the function just from the player, it works fine, it moves the player no problem. The problem is that the function just isn’t being called when I call it from the gamemode.

Something I just recently found is that the gamemode will rest vars between levels. My guess is the the player var in the game mode is not referencing your player. Use a Cast to whatever bp your character is and use a get player character.