Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
Hello, I have a question. I want to create an action when the shooting is finished, perform the act of changing bullets, only after the completion of the act of changing bullets can continue to fire. |
||||
|
You can simply use variable to achieve this... just use an if a variable has a value do something action to the shooting button. for example when right mouse is pressed down and if a variable "shoot" is 'allowed' then perform action shoot.... now add another action of set variable to the reloading action.. for example when a key pressed "R" then set or change variable "shoot" to 'not_allowed' then plays animation calculate the time taken to complete the animation...then add another action do something later suppose ur animation is of 2 second then after 2000 ms set or change variable "shoot" to 'allowed'... this method can also be helpful when you want to stop firing if player is out of ammo.... hope that helps... |
||||
|
Dear friend, could you give me an example file? https://drive.google.com/open?id=14OeR1U-tIbTTFnjZqp7KXIe_j19CU-A7 |
||||
|
For example, when using a sniper rifle, after the shot is finished, the gun will automatically reload, after the reload gun can fire again |
||||
|
I have sent an example file, can you help me complete the above request? |
||||
|
Allright here is the updated example file you have provided to me... after shooting one bullet the gun will reload... you have to create an inventory setup.. if you want the gun to be reloaded after a limited number bullets have been fired. current example will fire one shot and will disallow the player to shoot while reloading. it will load one bullet at a time if you want to load more bullet than 1 at time you can increase the time in do something action for example '2500' ms to load five bullets '500' ms is load of one bullet in the reload loop animation. you can tweak the variables as per your need. it is only to make you understand how it works... Here is the link to download the ccb file: https://drive.google.com/file/d/... hope this helps you out... |
||||
|
That's great, thank you, I never thought it contained so many functions! hihi......but can I attach a right mouse button to perform a aiming action from a distance? |
||||
|
Yes you can add righmt mouse button functionality for aim, but this will require to add more behaviors and actions to be attached. |
|