Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Need help with attack point collision only activating on a certain frame

Discussion in 'Animation' started by DTheChemist, Aug 7, 2021.

  1. DTheChemist

    DTheChemist

    Joined:
    Jan 18, 2021
    Posts:
    115
    I thought i could figure it out on my own through the animation window where you can preview your sprites but no dice.

    What i wanted was to add a Collision box to size it to the same frame width as my weapon the character has. Its a 2D (Nes style) sprite.

    What is the proper method to do have your collision box only appear when the character is swinging the weapon forward but disappears after the action is over? I wanted to disable it when hes not in a certain frame and i wanted to enable it on when hes at that frame of attack

    Image below of what i tried to do by adding the collision object to the frame of attack. i thought it was as simple as that. But the issue is the collision box stays there on screen that whole time and of course the enemies run into it like wall object

    Question: "How would i enable and disable a hit collisionbox for attacks on a certain frame"
    bandicam 2021-08-06 19-33-38-083.jpg