Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • 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 Tasaq · Oct 03, 2013 at 05:41 PM · saveplatformersystemstatecheckpoint

Checkpoint system in platformer

Hi,

I would like to ask how to create a checkpoint system similar to Crash Bandicoot. More specifically I would like to mimic this sitiuation:

  1. Player activates checpoint making new respawn point.

  2. Player goes futher in the level, collects items etc., but he loses a life before he reaches next checkpoint.

  3. All items that were collected after checkpoint activation are lost and respawned in the level(in Crash examle those would be crates, enemies and woompa fruits).

I drag&drop my items on the scene as prefabs. Simply put I would like to save a state of my scene and revert to it after death. Any suggestions? :)

Comment
Add comment
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

1 Reply

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

Answer by Joel_Ruiz_WV@yahoo.com · Oct 03, 2013 at 06:25 PM

There are many ways to handle this situation, you could have an array of transforms called "CheckpointsList" of your checkpoints. Then create an int named "Checkpoint"of which checkpoint your character will respawn at. And when he collides with your checkpoint plane change the "Checkpoint" int to its value plus one. So when he dies you can destroy the current player, and instantiate him at item "Checkpoint" of "CheckpointsList". To retain all items he had when he touched the Checkpoint platform, I would create another array and add a list of objects he had named "ObjectsInInventory". and when he touches a new platform, make sure to delete all the contents of "ObjectsInInventory" so there are no duplicates of objects he had already. Hope this helped if you need any scripting references comment. (:

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 Tasaq · Oct 03, 2013 at 09:34 PM 0
Share

I have no problems with scripting, only with concpets. I was thinking about similar concept actually, but I was hoping it'll be less compilcated in Unity... Like it has some magical built-in 'save state'/'load state' methods.

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.

Follow this Question

Answers Answers and Comments

15 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

simple checkpoint/save/load system in javascript 4 Answers

System.IO in javascript 1 Answer

Unity 3D 2018.1 - Save 0 Answers

Suggestions for Persisting Items' and Enemies' state between Load? 5 Answers

Checkpoint with PlayerPrefs 0 Answers


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