Profile image

[Question] [Solved] Delaying Cannon Fire and Engine spool up

35.7k Speedhunter  8 months ago

Is it possible to get an engine to throttle up for 2 seconds upon pressing fire cannons, then go back to 0 after the cannon is fired after a certain delay?

Is it possible to:

A. Get a cannon to fire 2 seconds after the fire cannons button is pressed?

B. And get an engine to spool up before going back to 0 after the cannon is fired?

With funky?

So I basically need an engine to spool up for 2 seconds to glow (akin to charging up) before the actual weapon fires, and I also want to delay the firing response of the cannon part. Is it possible with funky?

  • Log in to leave a comment
  • Profile image
    35.7k Speedhunter

    Sorry for long title

    Pinned 8 months ago
  • Profile image
    35.7k Speedhunter

    @MonarchiiwithastolenMG wait ima edit thr comment thetes a spelling error

    +1 8 months ago
  • Profile image
    70.0k Monarchii

    @Speedhunter hmhhh... noted for future references

    +1 8 months ago
  • Profile image
    35.7k Speedhunter

    Basically Ceil rounds off the second number, which means it only works when the ammo is at an odd number (fireWeapons is in the false condition)

    First number basically ends up with a .5

    Also add quotation marks around the Shock Cannon/weapon name since the red text does not allow it

    8 months ago
  • Profile image
    35.7k Speedhunter

    @MonarchiiwithastolenMG the odd number firing thing?

    (ammo(Shock Cannon)/2) == ceil(ammo(Shock Cannon)/2) ? FireWeapons : 0

    8 months ago
  • Profile image
    70.0k Monarchii

    @Speedhunter oh, I see, how did you do it tho? curious

    8 months ago
  • Profile image
    35.7k Speedhunter

    @MonarchiiwithastolenMG the Shock cannon uses a method that basically activates the engine only when the ammo count is an odd number now, so it still works the same way

    8 months ago
  • Profile image
    70.0k Monarchii

    what i would do is basically....


    • set the engine's Activation Group/Input to FireWeapons.
    • set up two cannons with the same name
    • one is a "prop" cannon(doesnt do anything) with idk, infinite ammunition and basic types Shell with 0 lifetime to make it immediately despawn, and also 0 flashScale and Volume, the ActivationGroup for this would be ceil(smooth(FireWeapons,1/2))
    • one is the actual cannon, with floor(smooth(FireWeapons,1/2)) ActivationGroup

    should work i think..? that's how i think i wouldve done it anyway, hmh

    +1 8 months ago
  • Profile image
    35.7k Speedhunter

    @Katzem The engine throttling up from 0% to 100%

    8 months ago