Profile image

How to make timer of loading for a cannon

5,197 Kurizin  2.0 years ago

I have a question of how to make a timer for a cannon.I need to know how to make the loading time of a cannon (tank) with display on the screen.
For example ,the game world of tanks. You shot and after that you see the timer of loading. I want the same. Can you help me?

  • Log in to leave a comment
  • Profile image
    5,197 Kurizin

    @hpgbproductions understandable , have a nice day

    2.0 years ago
  • Profile image

    @Kurizin i'm unable to help, as it works for me

    2.0 years ago
  • Profile image
    5,197 Kurizin

    @hpgbproductions none of your methods helped. It shows the same

    2.0 years ago
  • Profile image

    @Kurizin this exception should not happen normally, there is probably a bug in your game install
    The exception is also probably not related to funky trees, if the problem is UnityEngine.Touch
    Try:
    - reload the game
    - restart your PC
    - reinstall the game

    2.0 years ago
  • Profile image
    5,197 Kurizin

    @hpgbproductions it says:
    TypeLoadException: Could not resolve type with token 01000002b (from typeref, class/assembly UnityEngine.Touch, UnityEngine.CoreModule, Version-0.0.0.0, Culture=neutral, PublicKeyToken=null)

    2.0 years ago
  • Profile image

    @Kurizin check dev console for errors?

    2.0 years ago
  • Profile image
    5,197 Kurizin

    @hpgbproductions actually there is some problem in code or smth. I added all variables in your aircraft and put this on my tank and somehow it shows <alpha=#> and nothing else

    2.0 years ago
  • Profile image
    5,197 Kurizin

    @hpgbproductions thank you very much!

    2.0 years ago
  • Profile image

    I managed to make one

    • PreviousAmmo: Set the previous ammo value to the current ammo at the start or when the activator state changed, so the timer isn't restarted in those scenarios.
    • CannonActivator: Cannon activation variable. Remember to set the cannon activation group to this variable.
    • CannonActivatorChanged: 1 if the activator state changed, else 0.
    • AmmoChanged: 0 if the activator state changed. This prevents the timer from restarting. Else, 1 if the ammo changed. Else 0.
    • PreviousAmmo: Update the "previous" value for the next frame
    • PreviousCannonActivator: Update the "previous" value for the next frame
    • TimeSinceAmmoChanged: The variable you can use in a label
    +1 2.0 years ago