Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Weird Looking Animation, Animation Problems

Discussion in 'Scripting' started by unity_vwgTK-tkKqJy2A, Feb 1, 2020.

  1. unity_vwgTK-tkKqJy2A

    unity_vwgTK-tkKqJy2A

    Joined:
    Jan 18, 2020
    Posts:
    8
    Hi, I want make animation to sword in my 2d game, it works cool, until I need to move item somewhere in the scene, If game is started, I cant move sword even in Editor, or using Script (to make sword stay, where my player left this) if I use Root Animation (or something like that, in animator) Everything what is wrong before, now works great, but animation looks kind a weird, normaly, sword should swing around the point, which is in the Handle, It does it when Root Animation is turned off, but when I turn on, its turn around the point, which is some like 1 sword lenght under the Handle
     
  2. MaximumTre

    MaximumTre

    Joined:
    Nov 28, 2015
    Posts:
    163
    If I understand what you are saying, it sounds like the sword isn't in the right transform. If you are using a humanoid, you should have a Right/Left hand transform. Make a child transform to that Transform and call it SwordEquip or whatever then put the sword object there. Either that or you have a Rigidbody on the sword and it moves because you don't have the constraints set properly. Just my guess from what I'm reading. Hope that helps.
     
  3. Stardog

    Stardog

    Joined:
    Jun 28, 2010
    Posts:
    1,890
    You should parent the animated GameObject, then move the parent. You can't move the animated part because the animation is setting the position.
     
  4. unity_vwgTK-tkKqJy2A

    unity_vwgTK-tkKqJy2A

    Joined:
    Jan 18, 2020
    Posts:
    8
    Yes, so how I can make, that animation position changes with the item position ? I make it Parent of Player, but when I want to player put down the Item, Item goes Instantly to the centre of map (start position) but not to the position where Player put down this, I can make Video of how it looks, but It took me some time
     
  5. unity_vwgTK-tkKqJy2A

    unity_vwgTK-tkKqJy2A

    Joined:
    Jan 18, 2020
    Posts:
    8
    That's The video
     
  6. unity_vwgTK-tkKqJy2A

    unity_vwgTK-tkKqJy2A

    Joined:
    Jan 18, 2020
    Posts:
    8
    That's sound good, but I cant do this Simpler ?