Search Unity

Resolved Character has false Y Positioning

Discussion in 'Animation' started by TheWitcher187, Jan 31, 2023.

  1. TheWitcher187

    TheWitcher187

    Joined:
    Nov 22, 2022
    Posts:
    7
    Hi guys,

    I am a newcomer when it comes to Unity3D. I am a self learner, but now I need some help witch my problem. Here is the problem:

    I have two characters at the moment, one is the main character which is controlled by the user and the other one is a NPC. They both have the same animations but different animator graphs. The problem is, that my main character is somehow floating when he's standing or moving around. However as soon as he attacks or guards, he suddendly bounces back to the ground as he should be anyways. I tried looking for similar issues and found that you should change the offset in the navmesh agent, but that did not help. The strange thing is that the NPC which has the exact same animations is working perfectly fine without floating around.
    -----> See screenshots
     

    Attached Files:

  2. trib_nation

    trib_nation

    Joined:
    Jan 29, 2023
    Posts:
    8
    I'm not familiar with navMesh so if that's the issue I can't help. However from the standing and guard picture given it looks like the characters are slightly different heights which suggests you're changing the character controller's height to achieve this?

    To provide proper help we're going to need to know which variables you're changing in your animations. Also a couple of debugging questions:
    1. Are the graphics on your character on a different gameobject (child) to the controller object (parent)?
    2. Are you applying gravity in the character movement script?
    3. Does your weapon have a collider? Is that collider a trigger or a normal one? i.e. is the sword or shield making the player float?
     
  3. SF_FrankvHoof

    SF_FrankvHoof

    Joined:
    Apr 1, 2022
    Posts:
    780
    4. Are the pivot(s) properly set?
     
  4. TheWitcher187

    TheWitcher187

    Joined:
    Nov 22, 2022
    Posts:
    7
    Thanks guys,

    I reviewed your suggestions when I realized that the character controller box was causing my character to float o_O. I had to change the Y-positioning so that it was compensation the height difference of the nav mesh.
     
    SF_FrankvHoof likes this.