• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by thepra13 · Jun 04, 2011 at 12:56 PM · game

how can i create a check point in unity

hi everyone im making a game like mario and i wanted to nkow how can i create a check point that everytime my character pass through the game save automatically

Comment
Add comment · Show 4
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image thepra13 · Jun 04, 2011 at 01:25 PM -2
Share

im new in unity that why im making a simple game but can you give me a xample of the code pleasess

thanks

avatar image thepra13 · Jun 04, 2011 at 01:42 PM -1
Share

thanks everone ;)

avatar image HolBol · May 03, 2012 at 08:23 AM 0
Share

This isn't an answer to the question.

avatar image HolBol · May 03, 2012 at 08:24 AM 0
Share

Nor is this.

2 Replies

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by Catlard · Jun 04, 2011 at 01:06 PM

That's a complicated question. I'm going to guess you don't know a whole lot about coding, which is totally fine, but you'll have to do some work before you really know how to ask this question. Basically, you need to make a script that will store all the variables from the point you want, and then have that script detect if Mario (or whoever) has died. If he has, then it resets the game to that point. Does that help?

Cheers,

Simon

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Catlard · Jun 04, 2011 at 01:28 PM 0
Share

Have you tried downloading this Tutorial?

http://unity3d.com/support/resources/tutorials/3d-platform-game

avatar image
4

Answer by Peter G · Jun 04, 2011 at 01:36 PM

It isn't to difficult. Here would be the steps I would take:

  1. Place a trigger around the checkpoint area. That is a GameObject with a collider attached and the isTrigger button checked.

  2. Create a script for the player that manages their health and keeps track of their last checkpoint.

      //Example
         //PlayerManager.js
         var spawnPoint : Transform;
         var health = 4;
    
         function Die () : IEnumerator {
              renderer.enabled = false;
              BroadcastMessage("DisablePlayer", SendMessageOptions.DontRequireReciever);
              //------------
              yield WaitForSeconds(spawnLength);
              //---------
              renderer.enabled = true;
              transform.position = spawnPoint.position;
              BroadcastMessage("EnablePlayer", SendMessageOptions.DontRequireReciever);
              health = 4;
          }
    
    
  3. Create a script for the trigger that could look something like this:

      function OnTriggerEnter (col : Collider) {
             if(col.CompareTag("Player")) {
                   col.GetComponent.<PlayerManager>().spawnPoint = transform;
             }
          }
    
    
  4. When the player dies, don't destroy him, just reset him. It is much easier then transferring data from one life to the other.

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image venkspower · May 03, 2012 at 10:59 AM 0
Share

I am sorry to ask this, but where are the functions "DisablePlayer" and "EnablePlayer"?

avatar image LearningWhileScrewing · Jun 15, 2016 at 10:32 AM 0
Share

that dosen't work like that it does nothing ofc no errors that's good but it is just weird java script checkpoint.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

getting udp package info inside unity (GlovePIE) 0 Answers

I place an object on the map and when I start the game it's in a different place 1 Answer

Will not shoot, also my character will only move side ways. 1 Answer

thrid person help 1 Answer

GUI Texture not showing in Game 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges