Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice
  3. Dismiss Notice

Question Idea for Simple hit reaction system by parenting bones to empty objects

Discussion in 'Scripting' started by billygamesinc, May 16, 2024.

  1. billygamesinc

    billygamesinc

    Joined:
    Dec 5, 2020
    Posts:
    366
    I would like some feedback on if this the proper way to do this. I want to implement a hit reaction/flinch system that adds onto the existing animation rather than overrides it. By parenting the bone (like a torso) to a game object I can move that parent object by code and not have it affect the animation.

    I was wondering if this is the proper way to do it as the only way I know how to modify bones via code is via LateUpdate but that just overrides the animation.
     
  2. RadRedPanda

    RadRedPanda

    Joined:
    May 9, 2018
    Posts:
    1,655
    There's additive animations, no scripting really needed (besides triggering them), I believe if you just name a second animation layer there should be a toggle to make it additive.
     
  3. billygamesinc

    billygamesinc

    Joined:
    Dec 5, 2020
    Posts:
    366
    I've used them before but they're quite finnicky and inconsistent and you really don't know what they look like prior to testing and they aren't as configurable vs code.