Hey, I was wondering how would you code 2 objects snapping in a specific position for the animation to be in sync. For example, most games, where a grapple attack would be the character grappling the enemy and the enemy would snap to a specific position for the animation to be in sync. How would you code this? Hope you guys understand.
I would only snap one of the objects, not both. You could parent an empty to the player exactly where the enemy needs to be and either have him seek to the spot or just appear at the spot.
Oh okay. So just have object1 to have an empty parented to him, and if it’s going to animate i would just snap object2 to that empty? Is that what you’re saying?
Indeed this is how I did it in the past.
but I did “snapping” if the distance to the correct position is less then a step to avoid “jumps”.
I assume you already have some sort of way to make sure the “grab” (or whatever) can be executed (distance, vector check). So on the key press to perform the grab, the enemy should be close to the empty already. If you have the enemy seek to the spot it might look a little better (he’ll slide a little but that can’t be avoided) but if you know the enemy will be very close to the empty, you could just set the enemy’s position to the empty’s and he will appear there.