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
-1
Question by Kashaunzilla · Apr 25, 2011 at 04:19 AM · killexperiencepergain

How to create a Expierence system for every kill

THE LEVELING UP SCRIPT HAS BEEN RECIEVED THANKS TO JOSHUA NO NEED FOR THE LEVELING UP SCRIPT NOW I JUST NEED A SCRIPT FOR RECIEVING THE EXP POINTS THANK YOU.

Well i want to make a experience bar system in unity3d. I went through and found some answers but they didnt help me much. So want to make it so that Everytime you kill someone you get 5 experience out of 50 at level 1. Then when you level up your going to need more then 50 experience. You will need 100 at level 2. Then level 3 you need 100. So you need to just double everytime you level up. and one you see your profile it shows a special texture like for a level 1 there is a Red dot and level 2 there are 2 red dots and at level 3 there are 3 red dots then level 4 it changes from dots to stars and so on. Oh and if you complete challanges your get like a extra 50 experience points and so on. So is there any way to do this. Just give me a full script and under it tell me what to do to use and if you want explain on how they work.

Well i have tried and here is my code for holding expierence points. Change it as much as you want.

var exp = 1; var expneeded : int = 50; var level : int = 1; var level1symbol : GUITexture; var level2symbol : GUITexture; var level3symbol : GUITexture; var level4symbol : GUITexture; var level5symbol : GUITexture; var level6symbol : GUITexture; var level7symbol : GUITexture; var level8symbol : GUITexture; var level9symbol : GUITexture; var level10symbol : GUITexture;

function Update () { if ( level = 1) { var expneeded = 50; level1symbol.mesh = true; level2symbol.mesh = false; level3symbol.mesh = false; level4symbol.mesh = false; level5symbol.mesh = false; level6symbol.mesh = false; level6symbol.mesh = false; level7symbol.mesh = false; level8symbol.mesh = false; level9symbol.mesh = false; level10symbol.mesh = false; } else ( level = 2 ) { level1symbol.mesh = false; level2symbol.mesh = true; level3symbol.mesh = false; level4symbol.mesh = false; level5symbol.mesh = false; level6symbol.mesh = false; level6symbol.mesh = false; level7symbol.mesh = false; level8symbol.mesh = false; level9symbol.mesh = false; level10symbol.mesh = false; } }

Well is keeps going with the else if ( level = . )

Thank you.

Comment
Add comment · Show 5
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 by0log1c · Apr 25, 2011 at 04:30 AM 1
Share

"Just give me a full script and under it tell me what to do to use[...]" this sentence made me turn away. That, and the code doesn't look like a very sincere try, but I don't want to judge skill, only ethic.

avatar image Joshua · Apr 25, 2011 at 04:31 AM 0
Share

"Just give me a full script" no one is going to do that.. try it yourself and if you have a specific question I'd love to help.

avatar image Joshua · Apr 25, 2011 at 04:32 AM 0
Share

Haha, posted while I was still typing, BY0 :p. Also, in your if( level = 1) statement you should write level == 1 and in your else statement you should say else if ;)

avatar image Kashaunzilla · Apr 25, 2011 at 08:35 PM 0
Share

Hey thanks dude i will try it, and i forgot to add the double ='s it was late and i needed some rest so i was rushing and also forgot to put the if statement in it too. So i am going to try it, thanks man.

avatar image Kashaunzilla · Apr 25, 2011 at 08:54 PM 0
Share

There have been no errors now then Joshua can you help me withing recieving the exp points from when the enemy dies. If ou know of the character damage script from fps tutorial from unity3d i would like it to be eddited from there please. Thanks dude, saw some of your badges and dude thats great, you got like 7 badges i have 3 or 4. $$anonymous$$eep up the good work

3 Replies

· Add your reply
  • Sort: 
avatar image
2

Answer by Aydan · Apr 25, 2011 at 06:25 AM

This should get you started

var exp = 0; var expNeeded = 50; var level = 1; var currentLevelSymbol : Texture; var level1symbol : Texture; var level2symbol : Texture; var level3symbol : Texture; var level4symbol : Texture; var level5symbol : Texture;

function Start(){ expNeeded = 50; }

function Update (){ AddjustCurrentExp(0);

 if(exp >= expNeeded){
     exp = 0;
     level += 1;
 }

 if(level >= 1){
     currentLevelSymbol = level1symbol;
     expNeeded = 50;
 }
 if(level == 2){
     currentLevelSymbol = level2symbol;
     expNeeded *= 2;
 }
 if(level == 3){
     currentLevelSymbol = level3symbol;
     expNeeded *= 2;
 }
 if(level == 4){
     currentLevelSymbol = level4symbol;
     expNeeded *= 2;
 }
 if(level == 5){
     currentLevelSymbol = level5symbol;
     expNeeded *= 2;
 }

}

function AddjustCurrentExp(adj) { exp += adj; }

function OnGUI(){ GUI.DrawTexture(Rect(10,10,30,30), currentLevelSymbol, ScaleMode.ScaleToFit, true); }

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 rangeray · Oct 20, 2013 at 08:20 PM

What about to program they enemy so it gives you xp too.

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 RealSoftGames · Sep 22, 2014 at 12:41 PM

i was thinking about using something with the Tags set to Enemies?

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

2 People are following this question.

avatar image avatar image

Related Questions

If Enemy Health (< 10) then Exp (+10)? 1 Answer

strange things in my script 1 Answer

Running an instantiation method from bools and a left-click... 1 Answer

How to make is kinematic false for all children of a gameobject? 1 Answer

How to get Var from a obj 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