Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperCube > Help with CopperCube
Gun and animation

thanhtoanhb
Registered User
Quote
2019-08-31 08:22:37

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.


🔎︎



just_in_case
Moderator
Quote
2019-08-31 15:15:07

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...


thanhtoanhb
Registered User
Quote
2019-09-02 03:12:39

Dear friend, could you give me an example file?


https://drive.google.com/open?id=14OeR1U-tIbTTFnjZqp7KXIe_j19CU-A7


thanhtoanhb
Registered User
Quote
2019-09-02 03:14:39

For example, when using a sniper rifle, after the shot is finished, the gun will automatically reload, after the reload gun can fire again


thanhtoanhb
Registered User
Quote
2019-09-02 03:15:45

I have sent an example file, can you help me complete the above request?


just_in_case
Moderator
Quote
2019-09-02 10:24:43

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...


thanhtoanhb
Registered User
Quote
2019-09-04 12:39:13

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?


just_in_case
Moderator
Quote
2019-09-04 15:22:33

Yes you can add righmt mouse button functionality for aim, but this will require to add more behaviors and actions to be attached.


Create reply:


Posted by: (you are not logged in)


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


Text:

 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


   






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