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 Glynbeard · Aug 10, 2011 at 11:52 PM · aicharactercontrollerissuezombie

Character Controller Is Lagging Behind Enemy

I'm working on a game with some basic zombie AI and everything seems to be working except for the fact that the character controller seems to be lagging behind the enemy as he moves which makes him sort of jump backwards every so often to correct himself and I'm not sure how to fix it. This also causes the enemy to seem to grow in my First Person camera view but not the other scene camera.

Here is a short video I recorded so you can better understand what I am talking about:

http://www.youtube.com/watch?v=4YFjX_5fUTo

If you'd like to see the zombie AI code it can be viewed here and the other code would be straight from the Unity FPS tutorial pretty much.

Thanks for your help, I really appreciate it!

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

2 Replies

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by Nate3d · Aug 11, 2011 at 03:48 PM

Find your character in the Hierarchy, and look through its child objects. There should be something called "Root" or a similar name for the top-level joint in the skeleton hierarchy. I haven't worked with Mixamo animations so I don't know their naming convention.

Select the root joint and then open the Animation View (Ctrl-6). In the top left corner just under the record and play buttons, you'll see two pull-down menus where you can select the different animations applied to that character. You'll need to dig through this and find the walking-forward animation. Once you have it selected, look for "Transform", click the triangle next to it if it isn't expanded already, and select Position.x, Position.y, and Position.z.

Press the F key to center the animation data in the graph to the right. You should see one animation curve gradually increasing (or decreasing) in value, and doesn't return to its original value at the last frame. It will probably be Position.z. Select all the keyframes in that animation curve except for the very first one, and delete them. That should stop the character from animating itself off of your character controller.

(If you don't see an animation curve for the root joint that fits the criteria, it may mean there's another joint in the skeleton under the root that's translating forward- Perhaps a joint called "pelvis" or "hips.")

Here's the Animation View reference: http://unity3d.com/support/documentation/Components/animeditor-UsingAnimationEditor.html

Hope this helps!

Comment
Add comment · Show 2 · Share
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
avatar image Glynbeard · Aug 11, 2011 at 11:40 PM 0
Share

Aweomse that fixed the issue where he was jumping ahead of the character controller! However, he still seems to grow as he draws closer to me and our player scales are the same. Do you happen to have a workaround for this as well? Thanks again!

avatar image Glynbeard · Aug 16, 2011 at 03:11 PM 0
Share

Sorry to bother you again Nate3d, I just can't seem to fix this last problem. The mob (as it comes closer to me) lifts slightly off of the ground (slowly getting higher and higher). I'm assu$$anonymous$$g this is due to animation translations again and it slowly moves him up, but they rest of the animations seem to match up.

So I was just wondering if you had any last thoughts! Thanks :)

avatar image
0

Answer by Nate3d · Aug 11, 2011 at 01:01 AM

Looks like he has forward translation keyframes on his skeleton root during the walking-forward animation. Every time the animation loops, he pops back to the original local position.

Comment
Add comment · Show 1 · Share
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
avatar image Glynbeard · Aug 11, 2011 at 01:09 AM 0
Share

Is there any way to remove these keyframes from the animation? I got the animation from maximo in the Unity Assets store, if that's any help.

If this isn't possible, can I alter my script (mentioned above) to account for this extra forward motion?

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

3 People are following this question.

avatar image avatar image avatar image

Related Questions

Character Controller can pass through Collider 1 Answer

Prioritizing Player Animations 0 Answers

Click on an object and then edit the speed of my player? 1 Answer

Huge performance hit when spawning prefab with AI 1 Answer

following enemies simple AI problem 3 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