Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
Can any one plz help me i want to add a ammo limit so that you have to reload, not unlimited bullets |
||||
|
Use variables... Suppose you have a pistol with a magzine of maximum 6 bullets.. So u can create a vraible "ammo_pistol" with a value of "6" Then you can use when a key is pressed behaviour then attach action if a variable "ammo_pistol" has a value bigger than "0" and then attach another subaction to it... If a variable "ammo_pistol" has value less than "6" then add the shoot action and another action set or change a variable "ammo_pistol" subtracts by value "1" This will make you shoot with limited bullets only for the current example it will allow you to shoot maximum of 6 bullets... When you shoot it will decrease the ammo hy 1 and check if the value of bullet is greater than 0 and less than 6 and allow you to do a succesfull shoot... To make a reload functionality simply use set or change variable and then change the variable value to maximum ammo value for example "6" Good luck! ![]() |
||||
|
thanks |
||||
|
its not working i do it and when i click to shoot it does my animation but wont show bullet even when i set it to |
||||
|
Set it to what? |
||||
|
so at the moment if i put shoot if value bigger then 0 on shoot if i put shoot with scene node, i.e bullet it wont show the bullet |
||||
|
Ooops... Sorry my mistake... When you add the sub action if a variable "ammo_pistol" has a value less than ... Always use one value higher than the maximun ammo... Instead of using less than value"6"... Try using value "7".... |
||||
|
to make it easy for you here is the ccb file.... so that you can understand it better... pressing left mouse button will shoot and right mouse button will reload... https://drive.google.com/file/d/... |
||||
|
Thank you a lot |
|