Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by nerdares · Aug 26, 2015 at 12:46 PM · bugmecanimcomponentthird person controllerfloating

Mecanim Issue

So I downloaded the blacksmith characters and I am using the challenger as my third person character. I scaled him to 10 so he would fit my environment. Then I added an animator component and called it: WallaceAnimation (I thought Wallace would be a good name for now), and applied root motion.

Here is what my animation tree looks like:

alt text

By default he will be idle which is what it should be obviously.

Locomotion is a blend tree and this is what it looks like inside:

alt text

The inspector says this:

Blend type : 1D

Parameter (to us as default): Direction

Motion:

  • RunLeft: Threshold @ -1, (and the next box, which I don't know what to call it) @ 0.9933442

  • Run (Run forwards): Threshhold @ 0, @1.013583

  • RunRight: Threshold @ 1, @ 0.9933442

Automate threshold checkbox in unchecked Compute threshold is default Adjust time scale: Homogeneous speed

The two parameters being used is speed initialized at 0.0 and the same goes for direction. Both are floats.

The model has a rigidbody, mass of 60 and xyz rotation frozen.

It has a capsule collider: IsTrigger = uncheckd No material center is -0.05,1,0 Radius is 0.3 Height is 2

(This is because the gameobject the model is store in is a bit weird position. A little offcentered. Didn't want to mess with it thought yet)

and it has this script

 using UnityEngine;
 using System.Collections;
 
 public class CharacterControllerLogic : MonoBehaviour
 {
 
 
     #region Private Variables
     [SerializeField]
     private Animator animator;
 
     [SerializeField]
     private float DirectionDampTime = 0.25f;
 
     private float speed = 0.0f;
     private float h = 0.0f;
     private float v = 0.0f;
     #endregion
 
     // Use this for initialization
     void Start () 
     {
         animator = GetComponent<Animator>();
 
         if (animator.layerCount >= 2)
         {
             animator.SetLayerWeight(1, 1);
         }
     }
     
     // Update is called once per frame
     void Update () 
     {
         if(animator)
         {
             h = Input.GetAxis("Horizontal");
             v = Input.GetAxis("Vertical");
 
             speed = new Vector2(h,v).sqrMagnitude;
 
             animator.SetFloat("Speed", speed);
             animator.SetFloat("Direction", h, DirectionDampTime, Time.deltaTime);
         }
     }
 }


However there is a problem. Whenever I climb up my terrain, my character starts floating a bit but then gravity takes it down. Is it because of the code, animation, capsule collider, or rigidbody mass? Idk what it is. (It might be helpful to do the exact same thing I have to check what is going on, like download the asset and do similar animations and code.

helppicture1.png (36.1 kB)
helppicture2.png (44.5 kB)
Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

2 People are following this question.

avatar image avatar image

Related Questions

Animation not blending properly 1 Answer

How to delete Mecanim files? 0 Answers

Mecanim Floating Feet 0 Answers

Mecanim random Bugs 1 Answer

Works after restart then crashes again ! "There is no 'Collider attached... a script is trying to access it" 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges