• 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 kawainu07 · 3 days ago · animation

Newbie animation problem

Since my post on the forums got buried and ignored, I'm posting this here hoping to get some help. As the title says, I have an animation-related problem and I have no idea how to fix it. I should mention that I'm not a programmer. I just grabbed small parts of different scripts from all over the internet and everything worked fine until now. I'm having a weird problem with certain children objects moving in weird ways during transitions between animations. I created a tank model and this of course includes the tank treads. The treads are made of many separate small pieces next to each other, each one with a single bone which is moved through a certain path to make it look like the tread is made of connected pieces. When playing the animations in the inspector, they looks just fine, but when I get to the game, during certain transitions, the treads seem to "shrink" for a second then go back to normal. Upon closer inspection, it seems they are not shrinking, it's just that every single piece that makes up the tread moves along a certain imaginary line and they all converge at a certain point, after which they go backwards to their original positions. I have imported the model with just 2 animations. 1 making the right tread move forward, and 1 more to move the left tread. I didn't have an idle animation so I created one within unity. It's a ZERO frame lenght "animation" clip starting from frame 0 and ending on frame 0. I hope this doesnt cause any problems in the future. In the animator screen, I set the "idle" animation as the default animation, from which you can transition into a "rightside" (or "leftside") animation, then into an identical animation that plays at 2x speed. There is also the possibility to go from "idle" to "reverse driving" animation which is just the same animation as the others but played backwards. This weird problem with the tread "shrinking" happens in all transitions EXCEPT for 2: from "idle" to moving forward, and "idle" to moving backwards. I would expect this problem to affect all transitions in the same way but that's not the case.

I will post a wall of pictures to give you an idea of what I'm dealing with. If you want me to provide any more info or even the 3d model of the tank, just let me know.

Normal tread alt text

"Shrinking" happening alt text

Here you can see the pieces (and bones) that make up the treads alt text

Import settings alt text

Animator pics alt text

alt text

alt text

alt text

alt text

alt text

alt text

alt text

1st.png (183.4 kB)
2nd.png (153.8 kB)
Comment
Add comment · Show 2
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 ceandros · 3 days ago 0
Share

The problem is likely that they try to get to their original position when the animation changes, even if they are on the other side of the thread. Do you have any transitions?

avatar image Anis1808 · 3 days ago 0
Share

Do the two problematic transitions work in the preview in the Animator ?

2 Replies

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

Answer by kawainu07 · 2 days ago

Ok, I managed to solve the problem. In the end, the only thing that worked was to set the transitions between animations to a fixed duration of zero seconds. No idea why it works, but it works.

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
avatar image
0

Answer by SeaPeaMe · 3 days ago

Just to be sure you didn't make a stupid error like me, did you accidentally animate the parent of all the tracks? Did you make sure that in the animation panel that there are no "Scale" animations?

It could also be a collider issue, if you don't set them to Kinematic or if you make every track use gravity

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 kawainu07 · 2 days ago 0
Share

All the track pieces are parented to an empty game object which contains all the parts of the tank, and this empty game object obviously has no animation of it's own, but I did add an animator component to handle the animations on it's children objects (the track pieces). You can see it on the 3rd picture posted above.

Regarding "scale" animations, if you are talking about an animation that changes the size of one of the animated parts, then no, there is no scaling at all. Animations merely move the pieces around, never scaling them, never re-shaping them.

As for the last part, the tread pieces do not have any colliders, and no rigidbody either. The treads are there for visual purposes (you dont want a tank to be magically floating around for no reason).

avatar image SeaPeaMe kawainu07 · 2 days ago 0
Share

OK, so this might be a pain, but what you could do is add an animator & animation to the parent holding ALL the tracks and animating the tracks from there

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.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

302 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Can I make animations snap to a frame? 2 Answers

How to select an animation clip by index number? 7 Answers

Can the animation editor create local rotational data? 3 Answers

Adding animation clips via script 2 Answers

How to hook up the particle system to jump animation? 1 Answer

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges