Well, i have an arcade game where there is archers. I want them to shoot a single arrow every time they are at the frame 13 of the attack animation. But, actually they are some times passing through frame 13 without shooting and some times shooting 2 arrows at same time when passing through frame 13. What may be the problem adn how can I solve this?
Using a frame number for a trigger is unreliable as the the framerate could be low, making it skip frames.
You could narrow it down a bit with making it something like frame > 13 combined with a trigger once.
But personally I would use an user interaction, such as key press or touch etc.
Develop games in your browser. Powerful, performant & highly capable.
I can't use user interaction because the archer is only a troop in middle of many. Every archer fights the enemy troops automatically when they see 'em so i need them to shoot their arrows in th exact moment they are at frame 13, to be more realistic.
Perhaps split up the animation
Frame 0 to 12 "first_part"
Frame 13 to X "second_part"
Start the animation "first_part" because of what ever reason
On animation "first_part" finished
fire the arrow
Start animation "second_apart"
Good idea. Thank you bro.