Author Topic: Gun fire delay?  (Read 895 times)

Stupid question:
How do i set a delay between firing if i was editing say..., the gun script?

As in click 1 2 3 Fire or fire 1 2 3 then you can fire again.

As in Fire 1 2 3 and then you can fire again.

find
Code: [Select]
stateName[3] = "Smoke";
stateEmitter[3] = gunSmokeEmitter;
stateEmitterTime[3] = 0.05;
stateEmitterNode[3] = "muzzleNode";
stateTimeoutValue[3]            = 0.01;//make longer, like 1.00 or something
stateTransitionOnTimeout[3]     = "Reload";
and change stateTimeoutValue[3].

Reasoning: if we do it in the fire state then it will wait that long until it starts smoking as well, which would look awkward. In the smoke state it will smoke normally and then delay until the allotted time has passed.

To make it smoke longer, change
Code: [Select]
stateEmitterTime[3] = 0.05;