Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 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 cwaite84 · Nov 21, 2013 at 07:16 PM · javascriptexperienceleveling

Need help with a proficiency system(experience system)

Hello there! So I have been trying to think of ways to implement this idea of a proficiency system for while. Basically I wanna have a system where if you damage an enemy it send back the damage amount to the proficiency and acts as experience. Although I want it set up through weapons. So if I am using an AK-47, and damage an enemy it send that amount of damage to the Assault Rifle Proficiency. Or if I am using an Pump Shotgun it send the damage amounts to the Shotgun Proficiency. If any of you have played the first Borderlands you will have already experienced this, and that is what I am trying to make. Any ideas on how I would go about actually doing this? Any help or guidance would be extremely helpful as I love to learn! Thank you in advance and hope you have a great day! :)

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

Answer by newb_quest · Dec 05, 2013 at 05:22 AM

I am a newb, so take this with a grain of salt, but I think your problem is pretty solvable. You should be able to know the amount of damage caused, inside the weapon script that calculates damage to apply to your enemy.

If you spawn a AK47 bullet prefab and send that at an enemy you will likely have to make a decision about what is the damage amount associated with getting shot by an AK47. I would assume that that logic is in the script for your weapon or bullet.

Then you could OnCollisionEnter or OnTriggerEnter when the bullet hits the enemy and have the bullet damage variable of the projectile or gun decrement a health variable on your enemy.

Since you will probably be doing some passing of variables from one script to another and between scripts on different gameobjects you will probably need to familiarize yourself with GetComponent. This is a really useful functionality that will allow you to access and change variables in other scripts. Combining this with OnTriggerEnter you can do things like 'When this hits something, change variable X in script Y of that something"

The larger point is that unless there's some complicated calculation or damage modification happening inside the enemy health script (because of armor maybe, or taking different damage for diff body parts) then you should know your damage amount from the start and be able to take that same number and add it to your proficiency tracking script.

Good luck!

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

17 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 avatar image avatar image avatar image avatar image avatar image

Related Questions

Simple EXP Script In Javascript 0 Answers

A node in a childnode? 1 Answer

PlayerPrefs reset error 0 Answers

Experience System 1 Answer

Borderlands Style Proficiencies 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