Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import bge
- from bge import logic as g
- def save():
- s = g.getCurrentScene()
- pos = s.objects["player"].position
- rotP = s.objects["player"].worldOrientation
- rotC = s.objects["player_camera"].localOrientation
- g.globalDict["pos"] = [pos.x, pos.y, pos.z]
- g.globalDict["rotP"] = rotP.to_euler()
- g.globalDict["rotC"] = rotC.to_euler()
- print("SAVED")
- def load():
- s = g.getCurrentScene()
- s.objects["player"].position = g.globalDict["pos"]
- s.objects["player"].worldOrientation = g.globalDict["rotP"]
- s.objects["player_camera"].localOrientation = g.globalDict["rotC"]
- print("LOADED")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement