How do I show something being "counted down" on screen, like bullets depleting from a gun?
I'm creating a weapon that fires something, but I'm having trouble understanding two things:
1) How do I use an emitter to show something is being "shot".
2) How do I show a visual representation of something being depleted on screen. For example, if I have 30 bullets, each shot should deplete that on screen one at a time until it hits 0, which is where it needs to reset itself back to 30 again.
I can understand text/number displayers, and in theory I understand how the timer *should* work, but I have no idea how to do both. Help?
-
Literally just hook up a controller button to a counter, and hook up the counters current value to the number displayer. Once the counter hits 0, reset a reload timer and once that reload timer completes, reset the counter to max.
-
I would set a counters max limit to 30, and increment the counter every time a bullet is emmitted.
This would count up to 30 though so I would add a maths gadget and wire the max value of the counter into the top input on the maths gadget and the current value on the counter into the bottom input. Then set the maths gadget to subtract.
Wire this into the number displayer and you should be good.
Also remember to wire the counter complete output back into the counters reset input to reset once you have run out of bullets.
Hope this is helpful - Peter -
As completely bonkers as it sounds, your trick worked, Peter. I had a little trouble but I got it working. All I need to do now is add in sound effects and other things, which should be straightforward. Thank you!
-
I was wondering whether you could start a counter with a 'current number of' value set, then use a calculator set to whatever your 'trigger' is to just 'minus' something from the counter every time? Probably more long winded than Peter's suggestion but ended up needing something similar so I'll give it a go
-
I too got this working, but ended up using a signal manipulator to remove counts from my counter, then when the counter hits Zero, using a button to reload / reset the counter. Nice to have something like this in a shooter to make things a bit more tense.
Zaloguj się, aby dodać komentarz.