After getting player position it never wants to go to the “TPPlayer” node. Position is saved as map and as i checked it with breakpoint it adds right vector to the map and it wont exit, just snaps the screen and stays in the same place.
Pls help. Ty
Pls help. Ty
What is in ‘load next level’?
I think you are doing it in a wrong way. I would do it a bit more safer, but more complex.
Option 1: (Meh option, and only for Single Player, not optimized)
Player always updates it’s position in the GameMode / GameState, then you don’t need to use this GetAllActorsOfClass, but just read position from the game mode.
Option 2:
Your option is a bit flacky, as you get Actor position. What if that Actor is respawned in a moment of the Level change? You will get invalid position. Safest way is to do it through the Pawn itself, and by that you are certain that Pawn is exact player position.
Sorry for late response, but thank you for both solutions! Meanwhile i tested some other and tried something i came up with this. Maybe not optimal but works '![]()
Don’t use GetAllActorsOfClass in a Tick method :(.
I understand that, for starters, it is easier to go in to Tick, and do things there. But this is not why Tick method exists. Your software should be event based, a not Tick based. It’s way more optimized when it’s out of the Tick method.
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.