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 Ilias · Jun 25, 2011 at 07:54 PM · gamerestartkill

Don't restart game after killing Orb

Hi everyone.

I'm using the 3rd Person Shooter of Unity 3.

When i killed the Orb, the game restarts. But i won't let the game restart after killing the Orb. And i want to remove the Healthbar of the Orb on the screen. What should i do to fix that. You can see the example how i want it in the first minute of this video: Pantera 3d Third Person Shooter Gameplay

Someone can help me maybe? Please

Thnx

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 Waz · Jun 26, 2011 at 05:33 AM 0
Share

This question is very difficult to understand. Perhaps reword it to explain what you are actually doing.

avatar image Ilias · Jun 26, 2011 at 11:09 PM 0
Share

Is this better to understand?

1 Reply

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

Answer by FourSheds · Jun 26, 2011 at 06:58 AM

It's the DeathManager script on the Controller object that is controlling the restart. If you comment-out these lines:

 /*if (hc.tag == "Player")
       StartCoroutine(PrepareRestart(false));
 else {
          StartCoroutine(PrepareRestart(true));
 }*/

...you'll find that the game no longer restarts. If you killed the Orb, you'll need to Instantiate() another one!


If you want the player to respawn:

Change the code above to this, and notice the new position of the / /.

 if (hc.tag == "Player")
         StartCoroutine(PrepareRestart(false));
 /*else {
         StartCoroutine(PrepareRestart(true));
 }*/

Now the Orb will die without causing restart, and the player will respawn

If you want two Orbs, and you've duplicated the Orb in the scene, go to the Death Manager script on Controller, drag Orb2 on to the word "Entities", and this will add a 3rd element to the array of objects being controlled by Death Manager. Now it will die.

A good exercise would be to make a copy of the Progress Bar script, add this to "Controller" so it has 3 Progress Bars, and modify it so it is below the other one and monitors Orb2.

Comment
Add comment · Show 10 · 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 Ilias · Jun 26, 2011 at 11:03 PM 0
Share

were should i place this in the deathmanager? Because this is exact what's in the script. What should i do with that?

avatar image FourSheds · Jun 27, 2011 at 05:03 AM 1
Share

Place that code between / and / (as in my answer).

Those symbols will prevent the block of code between from running (called commenting out). Alternatively, you could delete that section of code, but it's sometimes safer to comment-out, as you can use/edit it again later if you need to.

avatar image Ilias · Jun 27, 2011 at 02:35 PM 0
Share

And how can i remove the Healthbar of the Orb? I sorry but i'm still a noob

avatar image FourSheds · Jun 27, 2011 at 03:08 PM 1
Share

O$$anonymous$$, I'll try to give you an answer that involves no coding:

In the Hierarchy, select 'Controller', then in the Inspector, switch off the Progress Bar Script. This will prevent the health bars from being displayed.

Then select 'Orb' , find the Health Controller script in the Inspector and set $$anonymous$$ax Health to a large number like 10000000. Do the same for the 'Human'. This will ensure the player or the orb will not die. (well, unless you play a single game for a month!)

avatar image Ilias · Jun 27, 2011 at 04:09 PM 0
Share

It's working :D Thank you. But one little problem, when i add an other Orb. Just the first one can die. The other can't die. I was shooting for 5 $$anonymous$$utes at him, (He has 100 Hitpoints) but he won't die. The first one died in a $$anonymous$$ute, but the other not, he can't die :S.

And maybe you can help me with an other question i asked it in an other Ask A Question. $$anonymous$$aybe you know what's the problem.

http://answers.unity3d.com/questions/135802/3rd-person-shooter-shadow-problem.html

Here is my other question about the shadow of the Human if he died.

Show more comments

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

I need a script that kills a variable rigidbody 0 Answers

getting udp package info inside unity (GlovePIE) 0 Answers

Trouble with restarting 2D tutorial 2 Answers

Option to restart the game? 3 Answers

Problem using 'function Update ()' to restart the game, error CS0246 2 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