• 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 DMacInto · May 02, 2011 at 06:14 PM · respawncheckpoint

Ok, new respawn and checkpoint system script issues

I have been checking out some of the scripts on the forum and found a script that I understand somewhat and want to use. So, I've tried to make it work for my final project which is a simple platform game. The object is to climb a tower by jumping from block to block, if you miss and fall to the floor you respawn back at the beginning (the floor is tagged "DEATHZONE". I've made spheres and tagged them as "respawn1" and "respawn2" so that the player can respawn back to the checkpoint instead of the beginning to make the game more fun and beatable.

Here is the script for level one, it only has one checkpoint because it is shorter.

private var originalSpawn : boolean = true; //private var respawn2 : boolean; private var respawn1 : boolean;

private var dead = false; var ex = 0; var why = 95; var zee = 0;

//function OnTriggerEnter(other : Collider) //{

function OnControllerColliderHit(hit : ControllerColliderHit) { if(hit.gameObject.tag == "DEATHZONE") { dead = true; } }

//You'll have to make a death script and make a boolean true false command. if (dead == true) { if (originalSpawn == true) { //Put your coordinates of the original spawn point. transform.position = Vector3(0, 95, 0); dead = false; } }

if(other.gameObject.tag == "this") //"other" is giving my an error. I think everything is ok in this script but I don't know. { originalSpawn = false; respawn1 = true; //respawn2 = false; }

if (respawn1 == true) { if (dead == true) { //Put your coordinates of the spawn point. transform.position = Vector3(1.522821, 35.63204, -18.85758); dead = false; } }

//if (other.gameObject.tag == "Checkpoint2") //{ // originalSpawn = false; // respawn2 = true; // respawn1 = false; //}

//if (respawn2 == true) //{ //if (dead == true) //{ //Put your coordinates of the spawn point. // transform.position = Vector3(x, y, z); //dead = false; //} //} //}

Please help me get this working because my final project is due tomorrow and this is the last thing I have to complete...I have some understanding of Java, but try not to blow my mind : )

Comment
Add comment · Show 2
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 burgunfaust · May 02, 2011 at 06:23 PM 0
Share

You should be using the "code" button on your code. It makes it easier to re. Easier to read means people actually look at your code. Better for you.

avatar image burgunfaust · May 02, 2011 at 06:24 PM 2
Share

What exactly is the issue?

0 Replies

· Add your reply
  • Sort: 

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

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

No one has followed this question yet.

Related Questions

Checkpoint system??? 3 Answers

Checkpoint script problem 1 Answer

Checkpoint with PlayerPrefs 0 Answers

how to disable animator after load in from checkpoint 0 Answers

Help with SendMessage 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