Jump to content

[Solved] Unity 5.3 animation transform rotations bugged


Recommended Posts

Ok, I've created numerous animations in Unity.  So it's not like I'm a complete noob at this. But for the life of me I can't figure out why one part I'm working on simply will NOT animate.

It works in Unity, just fine.  I have it set to legacy.

The .cfg looks like this:

                MODULE
                {
                 name = ModuleAnimateGeneric
                 animationName = fishAnim
                 startEventGUIName = Lower
                 endEventGUIName = Raise
	             allowDeployLimit = true	
	             revClampSpeed = false
	             revClampPercent =   true
                }

 

The GUI comes up, the button is there, the slider is there and when I click on the button it says it's moving.  The part doesn't do crap. I slide the deploy limit and it moves... and the part does nothing, in or out of the sph.

I've completely rebuilt the part in unity twice now, I've redone the animation at least 4 times, from scratch.  I've tried different parenting, etc.

I have the animation in the right place, it's on the parent object of the parts being animated. The animator is even deleted just to make sure.

I'm at wits end with this one.  I'm doing everything the exact same way I've done every other animated part and this one refuses to move.

And the log file has nothing.  No errors relating to the part, nada.

Edited by Fengist
Link to comment
Share on other sites

any errors during export? it's the only animation on the part?

try it without the DeployLimit parameters? if it works then, add the DeployLimit parameters and test them 1 at a time till you get the effect you want. 

Link to comment
Share on other sites

No, no errors, nothing.  Everything appeared to be working except the part simply wouldn't move.  I stripped it down to two game objects and still... wouldn't move.

And I just now figured it out and this is about as STUPID as the drag cube issue.

I wanted to rotate a part 40 degrees. That's all.

I just went through so much bull---crap, to the point I was deleting other mods from my install, re-exporting the .obj file, rotating the parts in my modeler, rewriting the .cfg file...  Just an insane amount of face-desking trying to figure out why this part wouldn't rotate in KSP but looked perfect in Unity...

I even animated other parts to make sure I hadn't had a stupid attack and forgot how to animate.  They worked fine.

Here's the stupidity...

In the animation I had the transform rotation.  That's not good enough for KSP.  I had to add in the transform LOCATION, even though it's completely unchanged throughout the animation.  The start value and the stop value are exactly the same.

But without it, the part wouldn't budge.

As soon as I added the location, the part rotated.

Unbelievable.

Thanks @nli2work.  I appreciate your help but short of a Unity screenshot I'm not sure anyone would have guessed that.

Edited by Fengist
Link to comment
Share on other sites

huh, that's interesting, never would have guessed that in a hundred years even with screen shots. This should be filed under double secret trivia questions for Alex Trebek.

what made you remove the translate curves on this one? 3D apps typically keys Translate/Rotate/Scale by default. Unity does as well. 

Link to comment
Share on other sites

@nli2work I never added any.  I do all my modelling in Wings 3D which doesn't do animations.  I import the parts into Unity and use it to create the animations.  I select the parent object of the parts I want animated, click on the Animation tab, create the animation then add what I want animated.  In this case, a transform rotation.  I doesn't automatically add in the transform position so there was no deleting to do.

Normally, my animations are position changes, not rotations so this little tidbit never occurred to me until I decided to try to move the part AND rotate it to see if I had a buggy .obj imported into Unity.  That's when the part moved AND rotated.

The last rotation I did was ages ago and I actually used Daz to do that then imported it into Unity and NOTHING I've ever read about creating animations in Unity said a transform position was required to do a rotation.

Yea.  I've just spent hours uttering all sorts of monosyllabic words over this fubar.

Link to comment
Share on other sites

4 minutes ago, nli2work said:

Hm, very strange. can you send me the part with the broken setup?

I'm not sure what you're wanting.  The Unity assets?

It should be easy to duplicate this problem.  Take 2 game objects, make one the child.  Select the parent, click the animation tab and create animation.  Add in the transform rotation for the child.  Set the animation timer to 1 second, make sure the record button is pushed and rotate the child part.  When you play it, you should see the part rotate.

Remove the animator, change the animation to legacy and drag the animation to the parent object.

Export the part.

The part.cfg, I just used an animate generic to test it.  The GUI button comes up, even the slider and it even says it's moving the part.  But it sure doesn't move.

That's basically what I did. 

Link to comment
Share on other sites

Unbelievable. I know why this all happened.  I've been beating my brains in for the past 24 hours with rotating animations and now I know why they don't work.

Unity 5.3

http://answers.unity3d.com/questions/1120170/cant-rotate-gameobject-with-animation-in-unity-53.html

6 months this has been busted and it's still busted.

Here's how you know you have the problem.  If you add a transform rotation to the animation timeline, then you click the add property button and that transform rotation is still listed as available, it's bugged.  It should disappear from the list of properties available to animate.  In my case, it doesn't.

Even though everything looks perfect, your animation looks great in Unity, it simply won't export the rotation.  Position seems to be fine, it exports it just dandy.

So, the solution:

Right click the transform rotation on the animation timeline and change the interpolation to Eular Angles(Quaternion Approximation).  

It instantly worked.

 

So, @nli2work, how's that for some obscure trivia for ya.  Cost me another year off my life.

Edited by Fengist
Link to comment
Share on other sites

Ahaha, damn. it was Unity's fault all along! Great sleuthing work though! I wouldn't have been able to replicate your problem since I'm not on Unity 5.3

5.2.4f1 is the one to stick with till Squad builds with newer version of Unity.

Edited by nli2work
Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...