Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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
5
Question by burns · Mar 29, 2011 at 03:27 PM · animationmovementpathfindingnavigationpathfollowing

Movement and animation

We have a path-finding/path-following script that navigates a character around fixed objects to reach its destination. We tested it out, and it works. So far, so good.

But as soon as we set it to start the character's walk animation (an animation of him walking in place . . . the path-following script takes care of the actual translation), the character's position keeps getting set back to his starting position every 10 or so frames (leading to a stuttering kind of motion). If I turn off the animation, the character translates as expected once again. It's as if the animation is somehow resetting the character's position.

Does this ring a bell to anyone? It sounds similar to Hunter_jonny's 2D problem here: http://answers.unity3d.com/questions/10789/animation-freezes-my-movement

But it doesn't look like he got an answer. (We already tried the empty game object suggestion, but that didn't make a difference, unfortunately)

Thanks, in advance for your help!

Comment
Add comment · Show 6
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 Justin Warner · Mar 29, 2011 at 04:12 PM 0
Share

Are you doing the http://unity3d.com/support/documentation/ScriptReference/Animation.CrossFade.html cross fade? If not, try that.

avatar image e-bonneville · Mar 29, 2011 at 04:33 PM 0
Share

Can we see the scripts where the problem seems to be located?

avatar image Owen-Reynolds · Mar 29, 2011 at 04:51 PM 0
Share

Try looking at the character's Transform in the Inspector as you run. Is the position really being snapped?

avatar image burns · Mar 29, 2011 at 05:16 PM 0
Share

Just switched to cross fade, but it behaves the same.

I should mention that the behavior was actually different when we added the empty game object as a parent - without the parent, the character exhibits the stuttering motion - with the parent, he moves, but from time to time it pops to a new location (sometimes clear across the level). This may happen every time the character rotates. We're looking into that now.

We also noticed that the character already has a position before we drag it into the scene. We're investigating to see why and see if that is affecting us at all.

avatar image burns · Mar 29, 2011 at 05:17 PM 0
Share

Owen, when the character stutters (no game object above it), the position does indeed snap back. With a game object the position seems to update correctly, though the actual character is popping all over the place in the scene.

Show more comments

1 Reply

· Add your reply
  • Sort: 
avatar image
2

Answer by Bunny83 · Mar 29, 2011 at 05:25 PM

I guess your animation animates the pivot point of your character. At least in one frame. You can check the animation in Unity with the animation window. Just open it and select your character (the GO where the Animation component is attached to). Now you can see all animation curves. Make sure that the parent (the topmost transform that you move via script) is not animated. Animations are absolute. That means there is no relative movement in animations so if your pivot have a transform.position curve that would set the character to the animated absolute position.

Your animations should be animated in place. Unity don't support motion delta and since you move your char with your own script i guess you had that already in mind.

Comment
Add comment · 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

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

No one has followed this question yet.

Related Questions

Weird jumpy motion of character in Navigation Fundamentals proect 0 Answers

Moving a Character Along a Path in Timeline 0 Answers

scripting for animation 0 Answers

Irregular Spherical Pathfinding 1 Answer

Help with Animator has not been initialized error 5 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