0
Answered

Automatic weapon shots

Rezus13 2 weeks ago in Shooter updated by Marti (Lead Developer) 1 week ago 3

Hello, how to make a shoots like M16? Shooting from a gun is leftmouse once pressed action. And I want to hold left mouse button and make a burst shot.

Unity version:
2018
Game Creator version:
1.0.7

Answer

Answer
Answered

Hi!

We're glad you're asking this, since it was a bit more complex to set up, but with the latest Game Creator version, it's piece of cake.

You know that you use the Trigger "On Mouse Down" to detect when the Left Mouse is pressed in order to shoot a single bullet, right? Instead of using "On Mouse Down", change the Trigger to "While Mouse Down". This will constantly execute the Action associated as long as you press the mouse button. Thanks to the Weapon's Fire-Rate property, the gun won't be shooting more bullets that it's intended to.

It was added on the last update, so if there's anything wrong, feel free to reopen this ticket :-)


Cheers!

GOOD, I'M SATISFIED

Thanks:) I've totaly forgot about shoot trigger... Making a game in night time.....

Satisfaction mark by Rezus13 1 week ago
Answer
Answered

Hi!

We're glad you're asking this, since it was a bit more complex to set up, but with the latest Game Creator version, it's piece of cake.

You know that you use the Trigger "On Mouse Down" to detect when the Left Mouse is pressed in order to shoot a single bullet, right? Instead of using "On Mouse Down", change the Trigger to "While Mouse Down". This will constantly execute the Action associated as long as you press the mouse button. Thanks to the Weapon's Fire-Rate property, the gun won't be shooting more bullets that it's intended to.

It was added on the last update, so if there's anything wrong, feel free to reopen this ticket :-)


Cheers!

well, okay, and what about character npc shoot? There is no trigger for that and he can shoot only once. I coppied it from your battle example

:-D Happy to see you solved it. Yeah, the Shoot Action works for both the Player and enemies. We try to build our modules so there are no specific Actions for the Player and other NPCs. This allows you to reuse Action lists created as prefabs for both the Player, enemies and allied NPCs.

Cheers!