I have recently made an ability for a game I’m creating, and I’m having some issues with timing the animation that the player does and the script for the visuals of the ability. I took two videos of what it’s supposed to look like and what it looks like most of the time.!!
The script uses a bunch of waits for when to rotate the cross and when to spawn the particles, which is probably the issue, but it’s the only way I know.
I would also love if someone could tell me how to improve the vfx!
Instead of relying on wait() or task.wait() for animation timing, you can use GetMarkerReachedSignal() from the Animator.
This allows you to fire the code when a KeyframeMarker is reached during an animation. To use it, you’ll need to add and name a marker in your animation using the Animation Editor.
This is way better than using waits, because it doesn’t depend on the frame rate or client performance meaning the timing will always match up exactly with the animation, regardless of FPS.