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 /
This question was closed Apr 24, 2013 at 04:08 AM by Loius for the following reason:

Not appropriate for Answers.

avatar image
0
Question by Ben Palladino · Aug 28, 2010 at 04:45 AM · weaponpickupstoremoneysystem

Money System Please Help!

Hey i would really like to make a weapon system for my FPS RPG (like fallout 3 or Borderlands) anyway i would like so when you kill an enemy they drop money and then you can pick up the money and use it to buy stuff. So can anyone tell me what to do to make the money fall from dead enemies and let the player pick it up and then how to make a store with weapons that you can buy?

Comment
Add comment · Show 3
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 Julian-Glenn · Aug 28, 2010 at 05:02 AM 0
Share

In other words: "Write my game for me!" At least take a stab at learning to script and then if you get stuck on some code people here will help. Try the Lerpz tutorial for starters

avatar image spinaljack · Aug 28, 2010 at 01:57 PM 0
Share

var money : int; there you go

avatar image OrientalTaste · Aug 28, 2010 at 07:23 PM 0
Share

nay nay - var money : float. So all the micro transactions register 0.00101

4 Replies

  • Sort: 
avatar image
3

Answer by FLASHDENMARK · Jan 26, 2011 at 06:11 PM

If you really want this, you may need to work for it. This tutorials are not showing you exactly how to make a "Money and inventory" system but I think this 29 tutorials are proberly all the help you need to make a inventory system/Money system.

TornadoTwins explains a little of everything about Unity 3D and offers a great insight in scripting. And when you watch all of hes tutorials you will proberly have 99.9 % of what you need to make a system like this. Though a little logical thinking may be needed but dont worry about that ;) I am sure you will have what it takes!

TornadoTwins

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
avatar image
1
Wiki

Answer by AVividLight · Jan 26, 2011 at 04:34 PM

Dear Ben, I am not going to write your code (because that would not help you), but I will try to get you started... I haven't tested this code, but it is how I would start going about writing it... You will need another script to call the function "Dammage" (by using SendMessage) and you will need to add a lot more, but (I think) this is a start... If anybody else want to edit this (if you see something wrong, or something) feel free to... I Wish You Luck!

var living : boolean; var ammountToDrop : float = 10.5; var health : int = 100; var player : GameObject;

private var damageTaken : int = 0;

function Damage () { if(living = true && damageTaken <= health) { print("Alive And Well"); } else {

Destroy.gameObject; player += ammountToDrop;

}

}

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 Christopher K. · Dec 22, 2010 at 02:56 PM

As Spinaljack said, add var money : int; to your player's controls, then add some code onto the enemies that adds money to the player's total when the enemy dies(Because taking the time to pick up all the money would become tedious fast).

As for making a store, all you have to do is come up with your inventory system, then subtract money from your player script when they buy and add the item to their inventory, unless they don't have enough, in which case you can embarrass your players by coming up with clever insults for the shopkeeper to say. Or convince yourself to go above and beyond and come up with a shoplifting system. It'd take quite a bit of effort to do so, however, and you seem inclined to avoid the effort.

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 Boeing® · Apr 24, 2013 at 04:04 AM

without drop money and pickup that i can help you

 var money : int = 1000//amout of your money

 var moneyText : GUIText;//To Display Your money


 function Update()
 {
  
  if(money < 0)
  {
   money = 0;
 
  }
 
 }



and For Your Enemy

 var curHealth : int = 100;
 
 var maxHealth : int = 100;
 
 function Update()
 {
  if(curHealth > maxHealth)
  {
   curHealth = maxHealth;
  }
 
  if(curHealth < 0 )
  {
   curHealth = 0;
   
   moneySystem.money += 100;//name of your script moneySystem
  }
 
 }
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

Follow this Question

Answers Answers and Comments

1 Person is following this question.

avatar image

Related Questions

Weapon pick up 3 Answers

weapon pickup and equiping it to FPS player 2 Answers

picking up weapons script? 3 Answers

FindChild not working? (Pick up Object) 2 Answers

Player Animation change when pickup Weapon 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