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 eeveelution8 · Mar 11, 2013 at 12:51 AM · simpledeathhealth

SIMPLE player HP

ive searched for half an hour through forums and the asset store, but found overcomplicated versions of health scripts. the kind i'm looking is a script where you have 100 HP, and if its less than or equal to zero, you get sent to a menu.

anyone know where to find a tutorial for it?

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
1
Best Answer

Answer by AlucardJay · Mar 11, 2013 at 01:29 AM

This is where you have to start looking at things that will teach you, or learn to break down what you want to do, search on those things and put your script together.

How to have 100 hp ? create a variable.

 var myHP : float = 100.0;

if its less than or equal to zero ? you just wrote the script there. Use a conditional check.

 if ( myHP <= 0 ) { //Do Stuff; }

you get sent to a menu ? // Do Stuff : http://docs.unity3d.com/Documentation/ScriptReference/Application.LoadLevel.html

http://docs.unity3d.com/Documentation/Manual/PublishingBuilds.html

This is not going to be a continuation of everyone teaching you to code for each step of your project where you need a script. There is a literal ton of learning material out there. You need to get the basics of programming down, and get familiar with some of the features of Unity. Make a lot of small projects, that only do one thing, then when you have some experience, start on your first big project. This is the much quicker way to get your big project done, trust me!

Here is a list of tutorials to get you going :

Start at the bottom and work up : http://www.unity3dstudent.com/category/modules/

this is the YouTube link for the above as one playlist : http://www.youtube.com/watch?v=-oXYHNSmTxg&list=PL27B696FB515608D2&feature=plcp

the Unity Wiki : http://wiki.unity3d.com/index.php/Tutorials

A list of resources : http://answers.unity3d.com/questions/12321/how-can-i-start-learning-unity-fast-list-of-tutori.html Helpful page with information on using Built-In Arrays and Lists :

http://www.unifycommunity.com/wiki/index.php?title=Which_Kind_Of_Array_Or_Collection_Should_I_Use?

The unity wiki link above is very handy with lots of scripts and shaders too (just check out all the links down the left, and the tabs along the top : http://wiki.unity3d.com/index.php/Scripts )

Happy Coding =]

http://video.unity3d.com/video/7720450/tutorials-using-unity-answers

the FAQ appears at the top of the page : http://answers.unity3d.com/page/faq.html

also : http://answers.unity3d.com/questions/133869/how-to-ask-a-good-question.html

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 AlucardJay · Mar 21, 2013 at 04:43 AM 0
Share

Hello. Did this answer work, or did you find the suggestion useful? Please post a comment or mark an answer, for future reference by other people searching this 'site.

Watch : http://video.unity3d.com/video/7720450/tutorials-using-unity-answers

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

11 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

Related Questions

How can I lose health when my enemy collides with the player? 1 Answer

Player Will not take any damage! 1 Answer

How to add Player health and ability to take damage from a cube? 2 Answers

Player death/ game over c# 1 Answer

How to make death messages show at random? 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