Search Unity

Question How to properly do an attack in a game like an A-RPG or a Versus Fighting ?

Discussion in 'Animation' started by Peritios, Jan 7, 2022.

  1. Peritios

    Peritios

    Joined:
    May 12, 2019
    Posts:
    2
    Hi!

    I've now been trying to put in place a system to manage hitboxes on attacks for some time.
    (Unity version : Unity 2020.3.19f1)

    I'm trying to understand "how to properly do an attack in a game like an A-RPG or a Versus Fighting"

    I don't find any solution that's seems a good one, not without a toxic devpipe.

    Right now I have an attack animation made on 3dsMax (FBX). What I wanted was to use animation property to control/add/remove the hitbox of the attack frame by frame.
    But as once imported it is ReadOnly, I don't see how to animate the hitboxes uptop.

    Basically, I'd like to know of a pipe for designing attacks for A-RPG or Versus games. A way to pose and animate the hitboxes in Unity on top of another animation.

    Something enabling team members to do this : https://ultimateframedata.com/marth
    without having to write a single line of code!


    I hope some of you can tell me more about it!
    Thanks in advance and have a great day!


    Here are some of my reflexions up to this point:
    ♦ Adding hitboxes to the animation clip using properties → i can't add properties to an animationclip imported from a FBX.
    ♦ Extracting them from the FBX to remove the ReadOnly → have all animations in double + editing the FBX will force me to redo the hitboxes animations.
    ♦ Not touching the FBX and having a separate clip for the hitbox → also meaning to have 2 clip for one attack, and how can i work with the two clips at the same time to place correctly my hitboxes ? (which is the main objective)
    ♦ The first clip call the second with an animation event → Don't do anything in editor even with my script in [ExecuteInEditMode]
     
  2. Peritios

    Peritios

    Joined:
    May 12, 2019
    Posts:
    2
    Hey !
    I did not find any really "Good" solution for the time being.
    So i know that's not the right way to do it, but here some of my advancement :

    I use 2 AnimationClip :
    ♦ The animation of the FBX : the "Visual"
    ♦ An other animation clip who animate hitbox (permanent child of my player gameobject) using properties : the "Functional"

    To create and animate my hitbox, i use a Timeline in a dedicated scene.
    I put my two animationclip in the Timeline, so i can play my two animation simultaneously and animate the properties of the "Functional" at the current frame to make the hitbox visualy match the "Visual".

    My solution to play them both is to use the "Functional" as the main and start the visual with an AnimationEvent at his start.