So i have this fixed camera system..it works fine in the level.
the problem is now im trying to make a Save game system where player save the game and when they loads the level the last activated fixed camera will be ‘‘set view target to blend’’
the problem is the FixedCamera is only a one BP.so there are multiple actors in the level..when loads only the latest actor i placed in the level will be on the view target..not the last one player activated..My question is how to do i save the specifc activate cam in specifc fixed camera actor and load it
First image is Saving the Activate camera boolian and then load it in
second image is the camera setting
im trying to figure this out for two days now..help would be amazing
I’m leaving you a post where this topic is discussed, along with the official documentation that explains how to properly create a save and load system.
If it still doesn’t work after that, you can share the complete blueprint of your camera and I can try to replicate it on my end to help you figure out the correct way to implement the saving logic!
thank you for the response..i tried in the level bp.saving each camera as one boolian per camera in SaveBP..and it did work.not sure if it is the best method since now if i have 20 cameras i have to save them all..but for now this will work.and if there is another workaround,it be great.thank you!
I do have two ideas for you to consider and test, if your current setup isn’t giving you the result you want.
1. Give each camera a stable ID
Add an exposed int variable to the camera blueprint. When placing them in the level, assign each one a unique ID (for example, starting at 0). You then only need to save a single integer representing the currently active camera. On load, loop through your camera actors, find the one with the matching ID, and set it as the view target.
2. Save by transform proximity
Another option is to save the player or camera location and, on load, find the closest fixed camera and activate it. Depending on your setup, you may need some extra checks to avoid jumping to the next camera unintentionally if they are close together.
The main issue with your current approach is that it relies on Get All Actors of Class returning actors in a consistent order, which is not guaranteed. Because of that, restoring state based on array order can produce different results between runs or after reloading the level.
If you encounter any other issues, please don’t hesitate to reach out.
An addition to stable ID , Guids can be used and think its the prefferred way.
Check ID, if not create one and look for Guid in the save data. Save data should be coralated with that Guid. Also I suggest having level names in save data too will be needed.