Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 LordRechy · Dec 19, 2015 at 08:49 AM · death

Cant figure out a script for dying

So, I have this script that tells me/console when a players health is low and or 0. but I can't figure out a script that makes it so when the players currentHealth is 0 then it comes up to a different scene. But i also want it so it logs them so they aren't in the game anymore. It's an online game and it uses matchmaking i have all this setup already but i don't want the players to like leave the game they are in just go to a different scene like a respawn screen or something and ya i think thats it right now so if anyone can help that would be great thanks!

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 LordRechy · Dec 20, 2015 at 03:17 AM 0
Share

Ok i now have death and what i mean is i dont want them to leave the game is i mean i dont want them to leave the game they are in if there are different games i want them to stay in the game with the same people and not leave the whole game, And when 1 player dies and goes to a different scene everyone in the game goes to a different scene i dont know why and i have been trying for 2 days now and still acnt figure it out.

avatar image allenallenallen LordRechy · Dec 20, 2015 at 03:18 AM 0
Share

Remember to use comments and not answers because you don't have an answer!!!! Converted to comment.

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by jrjr · Dec 19, 2015 at 11:21 AM

Confused on this. You want it so it logs them so they aren't in the game anymore but you don't want the players to leave the game. Not sure what type of networking your using... can't see any scripts so this is just going to be a generic answer: Make a death location that's a collider they can stand on somewhere far from where ever game play is. Put the player there and deactivate their camera and input other than menus you need. Have a camera that takes over attached to whatever corpse you spawned for them looking at the fact that they failed or were taken advantage of heh.. Then pop a menu up for respawn that they can select or have it happen automatically - relocate them to their spawn point and activate their camera and input.

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 tanoshimi · Dec 19, 2015 at 11:29 AM

 if(player.currentHealth == 0) 
   Application.LoadLevel("respawnScene");

?

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

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

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

How can I animate a death sequence for the FPS controller? 1 Answer

Why isn't my Death Script Working? 3 Answers

Death and animations 1 Answer

Count Deaths 2 Answers

.SetActive (false) deletes gameObject but it's effects still affect the player 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