Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperCube > Help with CopperCube
More than One Gun

behroz-khan
Registered User
Quote
2018-05-04 19:14:19

Is there any better way than creating a camera for each gun? In simple words i mean is there a way to make more than one guns.


just_in_case
Moderator
Quote
2018-05-04 19:33:13

You can create as many guns as you want....
Just use variable to trigger an action... Show and hide node...
But first you have to make all the guns children node to the player...
If player is aninated object attach them to the aninated joint...
And make all other weapons hidden and as per gameplay... Use the variable show and hide them ....
There are many ways to do this...


wild-master
Registered User
Quote
2018-05-04 19:54:58

I finished creating an example for you before I noticed just_in_case's answer. He's faster than a lizard.

Here's my example:
https://drive.google.com/file/d/...

I chose to disable collisions for the inactive weapon and enable collisions for the active one, so you can learn from that and be able to use weapons of different sizes because the collisions of the inactive ones won't affect the game.


just_in_case
Moderator
Quote
2018-05-05 05:03:02

Am faster than a lizard...... Hahaahah lolz.,.. by the way good example @Wild-master


behroz-khan
Registered User
Quote
2018-05-05 07:36:11

But I want guns that have different damage like:

Pistol = 30 demage with 2 s fire rate
AK 47 = 50 demage with 0.05 s fire rate
M4 Carbine = 70 demage with 0.01 s fire rate

This is just an example don't mind if they are wrong!


just_in_case
Moderator
Quote
2018-05-05 20:02:26

You can use variables for that too...
For example if a variable ak47 is 1 then do something....
And create another shoot action with faster bullet speed and high damage...
Remember you should apply the shoot behavior to the same node as of your gun...

For example suppose you have a gun scenenode named pistol which is attached to the playernode as a children... And you have already applied the behaior or action to make that gun appears and when the gun appears you have to set a variable "pistol" (can be anything)

Now you need to apply when a key prrssed down than do something to the pistol node... And then add action if a variable " pistol" is 1 then do something... And then add another action shoot... And apply the setting as you want...

Use same thing with other weapons too....




behroz-khan
Registered User
Quote
2018-05-06 09:17:08

Thanks for the answer just_in_case. But i think I didn't understood it well so please give me an example of it so I can understand it great!



just_in_case
Moderator
Quote
2018-05-06 12:16:54

Hmmm here is the example file.... You can change the weapons by pressing 1,2,3 and can see the diffrence in bullet speed... And if you add an enemy in the provided cxb.. You will notice that shooting the enemy with diffrent weapons will cause diffrent damage to him....

Hope you will now undertand the method to do this...

https://drive.google.com/file/d/...


Create reply:


Posted by: (you are not logged in)


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