🤑 Indie game store🙌 Free games😂 Fun games😨 Horror games
👷 Game development🎨 Assets📚 Comics
🎉 Sales🎁 Bundles

Help Please!!

A topic by Atlantic Development created 17 days ago Views: 50 Replies: 1
Viewing posts 1 to 3

Hi, how to add save inventory and construction on checkpoint??

This is checkpoint script

I use ULTIMATE SURVIVAL SCRIPT!!! https://www.assetstore.unity3d.com/en/#!/content/80368

 void Start()
 {
      
      
     if (PlayerPrefs.HasKey ("posx") == true) {
         Player.transform.position = new Vector3(PlayerPrefs.GetFloat ("posx") , PlayerPrefs.GetFloat ("posy"), PlayerPrefs.GetFloat ("posz"));
         Player.transform.eulerAngles = new Vector3(PlayerPrefs.GetFloat ("rotx") , PlayerPrefs.GetFloat ("roty"), PlayerPrefs.GetFloat ("rotz"));
     }
 }
 // Use this for initialization
 void OnTriggerEnter(Collider other)
 {
      
     if (other.CompareTag ("Player")) {
         
      
         // save player position and rotaition
         PlayerPrefs.SetFloat ("posx", Player.position.x);
         PlayerPrefs.SetFloat ("posy", Player.position.y);
         PlayerPrefs.SetFloat ("posz", Player.position.z);
         PlayerPrefs.SetFloat ("rotx", Player.eulerAngles.x);
         PlayerPrefs.SetFloat ("roty", Player.eulerAngles.y);
         PlayerPrefs.SetFloat ("rotz", Player.eulerAngles.z);
         Text3d.text = "Saved!";
          
     }
 }
 void OnTriggerExit(Collider other)
 {
  
     if (other.CompareTag ("Player")) {
         Text3d.text = "Enter Here to Save!";
          
     }
 }
} 
 
Moderator(+1)

Can't help you with Unity, sorry, but in any event you should ask in General Development. This category is for help with itch.io itself.

Moderator moved this topic to General Development