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 Fenuva · Oct 29, 2012 at 09:38 PM · spawncuberespawnfalling

Respawn after falling off script?

Greetings, I am currently creating a game where you have to jump from one cube to another and not fall off. I was wondering if there was any way that I could make it so the player respawns at the original spawn point after falling a little distance. Does anyone have scripts for my request? I am having a very hard time with this as I am quite new to Unity. May you explain in detail exactly what I do to have the player respawn on the original spawn point after falling off? I already created a invisible large rectangle under the map so the player falls off and lands on it. Now what do I do after this? How do I make it so the player teleport to the spawn point after hitting the invisible platform?alt text

image.png (312.1 kB)
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

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by gnubberlang · Oct 29, 2012 at 11:02 PM

That should be pretty easy. I would think you could just do an "ApplyDamage" kind of setup like the FPS tutorial and die after falling, or maybe set up the invisible block's oncollision to place the player back at the start.

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

Answer by ZenithCode · Oct 29, 2012 at 10:33 PM

Wherever you have the logic that shows your player has fallen off screen do this, Application.LoadLevel(Application.LoadedLevel)

Comment
Add comment · Show 3 · 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 FenuvaGames · Oct 30, 2012 at 08:28 PM 0
Share

I have set up something so that if the player falls off, it restarts the scene, but I don't like it. I want it so that my other scripts (Such as a timer or lives) do not restart when the player falls off.

avatar image ZenithCode · Oct 31, 2012 at 06:32 AM 0
Share

Ok. There is a simple solution for that problem.
Save the information you would like to keep in PlayerPrefs (stored in memory)

Check this out and let me know if you have trouble using it!

http://docs.unity3d.com/Documentation/ScriptReference/PlayerPrefs.html

avatar image The_Walrus · May 01, 2015 at 08:43 PM 0
Share

FenuvaGames,what is that script? its what i need

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

12 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

Related Questions

Falling off respawn 4 Answers

How to make an object spawn in different positions? 2 Answers

Falling off respawn script 1 Answer

Random cube length on instantiate... 1 Answer

change gravity after time 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