Unity Grab and fuk animation while fighting

badnewbie

New Member
Jan 15, 2019
1
0
(sorry for bad english)

Hello guys, i recenly decice to start to make a side scroller game in unity, and wonder with the catch and fuk animation while fighting that if it's come from 1 model ( the player or the enemy) or both? If both then i have to make bone for model?
 

JoGio

Member
Jun 19, 2018
128
140
Only the character initiating the event needs to trigger it. The other character needs code to receive instructions on how to respond to the grab, like snapping to position and temporarily losing control.

Here's how I would do it:

Say you have character A, who triggers the event, and character B who is the target.

1) Character A activates grab trigger and attempts to target character B
2) grab logic checks if character B is in range and vulnerable to grab. If yes: continue to step 3. If no: do nothing
3) characters A and B go into a state where they ignore input/AI controls so that they stand still until event is done.
4) characters B is translated to a position that matches the animation about to be played
5) Characters A and B begin playing the animation simultaneously so that the motion is in sync.
6) Once the animation is done, characters A and B are returned to their normal state where they are able to move and receive input (or character B didn't survive and is now knocked out or something)


As for the animation:

You don't need any extra bones to make it work. You would create an animation for each character and export those animations.

Once the animations are ready, you can simply "freeze" both characters so they temporarily stop moving and play the animations in sync. You may want to snap character B (since they're the one being grabbed) to a position relative to character A that will make the animation work.

Hope this helps. Let me know if you need clarification.