Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperCube > Help with CopperCube
Fully Automatic Firing?

weaponsempty
Registered User
Quote
2017-09-03 22:56:38

Is there any was to make a fully automatic gun? I have the meshes and everything, but how do I make it fire repeatedly as long as the shooting key is held down?


niko
Moderator
Quote
2017-09-04 07:34:59

You could do this using either scripting, or start with a behavior "every x second do something", where you check for if the key is down (probably using an 'if' action and a variable, and then do a 'shoot' action.


weaponsempty
Registered User
Quote
2017-09-04 15:30:38

Okay, but I'm absolutely helpless in scripting... (I'm trying to learn) I'll see if I can figure this out, thanks.


just_in_case
Moderator
Quote
2017-09-04 21:00:52

Assign a behavior when a key pressed do something ...

Key pressed= left click..
When key pressed down..

Assign an action... Set a variable....

Variable name= auto_shoot
Value= 1

Now add the same behavior again... But this time we will change it from key pressed down to key left up.

Key pressed = left click
When key left up...

Assign an action .... Set variable...

Variable name = auto_shoot
Value= 0


Now assign another behavior... Every few seconds do something...

Time ms= 100

Assign action if a variable has value do something...

Variable name= auto_shoot
Has value = 1

Assign the action shoot bullets

Leave the else section empty...

Now test the game it will fire the bullets if mouse left button is hold down..

Same thing waas explained by @Niko.. to you in the above post...

Hope it will work for u..




weaponsempty
Registered User
Quote
2017-09-05 01:02:16

It did, thank you guys so much!


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "?nternational" (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