0
$\begingroup$

When I mouse click the bullet fires automatically. Is there a way for the bullet to fire a second (or any set time) after the mouse click? I feel like other questions have addressed how to add delays between bullets but not before initial independent shots. Thanks!

$\endgroup$

1 Answer 1

1
$\begingroup$

there are numerous ways to implement delays, in this case for firearm firing. I will focus on the two easier methods: Logic Tics & Property Integers. The property type can be float too if you'd prefer.

Blender Math: 60 tics = 60 frames = 1 second

Example: Logic Tic

enter image description here

Example: Property (integer)

enter image description here

Download: Blend File

Unfortunately PasteAll.org is not accepting my blend file, either because it's a Blender +2.8x file or perhaps because it doesn't recognize new UPBGE source, so I've uploaded my blend to one of my Github repositories for commeridistribution. https://github.com/RandomPandaStudios/BSE-Firing-Delay-Examples

Download: Revision

https://github.com/RandomPandaStudios/BSE-Firing-Delay-Examples/blob/main/UPBGE_03_Firing_Delay_Example_v2.blend

$\endgroup$
6
  • $\begingroup$ Thanks for the suggestion but the file you sent is a default blend file when opened? $\endgroup$
    – Minato
    Dec 20, 2021 at 2:14
  • $\begingroup$ At the time of the upload, I was using the very latest UPBGE 0.3x release. Perhaps you need to update your UPBGE version? Additionally if you have a original Blender application set as your default program to open a blend file, you're going to need to either manually open my blend in your UPBGE 0.3 program or set your UPBGE 0.3 program as the default program for blend files. $\endgroup$
    – RPaladin
    Dec 24, 2021 at 1:58
  • $\begingroup$ Ok yes it works when opened on the newer UPBGE. I was actually asking about having a slight delay after clicking left mouse button, i.e. the bullet appears a split second after the button is clicked, but this is useful anyways so thanks. $\endgroup$
    – Minato
    Dec 24, 2021 at 14:09
  • $\begingroup$ You can easily implement this by using a boolean to keep track of whether the button has been clicked or not. Use this in combination with either of integer setups that I demonstrated in the blend file. I can create another blend example it if you want. But maybe best to create another question thread for that. $\endgroup$
    – RPaladin
    Dec 25, 2021 at 0:07
  • 1
    $\begingroup$ Done: github.com/RandomPandaStudios/BSE-Firing-Delay-Examples/blob/… $\endgroup$
    – RPaladin
    Dec 30, 2021 at 22:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .