Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperCube > Help with CopperCube
Negative Variable in CopperCube

Registered User
2023-07-27 22:46:05

I'm creating a system in my game, where I assign a variable called "Bullet Count" which stores the number of bullets the player has at a particular time which for instance, has a count of 25 (bullets). Bullet Count reduces as players shoot at enemies, but when the player shoots enemies and Bullet Count reaches 0(zero), I want the count to stop at zero and not go to negative numbers. CopperCube moves from 0 to negative numbers.

Registered User
2023-07-28 00:42:06

use the "if a variable has a value do something" action.
bullet count < (smaller than) 0 (zero) then set action to:
"Set or change a value" to:
bullet count = (equal) 0 (zero)

that way, if bullet count goes below 0 (zero), it will be made back to 0 (zero)

Registered User
2023-07-28 13:43:52

Thanks so much!

Create reply:

Posted by: (you are not logged in)

Enter the missing letter in: "?nternational" (you are not logged in)




Possible Codes

Feature Code
Link [url] [/url]
Bold [b]bold text[/b]
Image [img][/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]



Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact