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
0
Question by luniac · Apr 29, 2013 at 07:41 PM · animationlegacyadvice

Legacy Animation Advice

I've been using the legacy animator to create the most basic looping translation animations for cube primitives, for use in a simple platformer game for example.

Now with mechanim out I'm very reluctant to continue using the legacy system, but mechanim doesn't provide the ability to create super simple animations like what I mentioned within unity.

Plus now that i think about it, scripting transform translations would probably work better because i could make a generic script with public vars for transform start and end locations and i can just attach it to any object i want to quickly animate, instead of having to create a new .anim for that object.

But i have a few questions:

The animation component has a checkbox "Animate Physics". If i for example script a stretched cube platform to translate back and forth between 2 points and i give it a kinematic rigidbody, would there still be proper physics interaction?

Also, in the legacy animation window, the animation curve keyframes really came in handy because i could make them "flat" in order to create a smooth animation that would prevent a transform from snapping back once it reaches an end point if you know what I'm saying. How could i script it like that?

Is there a generic script available that i can use for these simple animations?

Comment
Add comment · Show 3
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 luniac · Apr 30, 2013 at 12:22 AM 0
Share

Ok I made this code:

 #pragma strict
 
 var movePosition : Vector3[];
 var speed : int;
 private var positionIndex : int = 0;
 
 function Update () {
     if(transform.position == movePosition[positionIndex]){
         if(movePosition.Length == positionIndex + 1)
             positionIndex = 0;
         else positionIndex++;            
             
     }
 //    Debug.Log(positionIndex);        
     transform.position = Vector3.$$anonymous$$oveTowards(transform.position, movePosition[positionIndex], speed * Time.deltaTime);
 }

$$anonymous$$oveTowards isn't producing a nice smooth motion when compared to using the legacy animation system and flattening out peaks.

Also, I'm getting very slippery motion on the platform(im using a moving sphere) when compared to a platform using the legacy system. On the legacy system platform i checked "animate physics" and i attached a kinematic rigidbody.

On the scripted platform, i get slippery motion with or without the kinematic rigidbody. What can I do? If i can't fix this then I'm forced to use the animation system which would get really cumbersome with many animations.

avatar image luniac · Apr 30, 2013 at 07:31 AM 0
Share

I dont understand how animating a cube platform using the animation system gives proper physics interaction, but just translating the platform through scripting does not...

For both methods i have a kinematic rigidbody and a box collider. Somehow checking "animate physics" makes it all work properly. The sphere will actually roll on the platform ins$$anonymous$$d of sliding.

I guess i need help with two problems. One is with making the physics interaction between the sphere and platform work properly like i mentioned above, and second is to script the translation so that i looks like it was made in the animation window with flat peaks in the position curves.

I guess the second problem can possibly be solved with some interpolation tweaks but i really dont know about the first problem... any help is very appreciated.

avatar image luniac · Apr 30, 2013 at 08:47 AM 0
Share

actually now that i think about it, perhaps i might as well just stick with the legacy system and just use the empty game object moving trick to lessen the number of clips i have to make... $$anonymous$$ecanim is pretty new anyways and will probably have simple animation features added in the future anyways...

Plus i really dont see afix for the physics interaction thing anyways...

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

13 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

Related Questions

The name 'Joystick' does not denote a valid type ('not found') 2 Answers

How do you set up a trigger animation without going through the collider? 0 Answers

Problem with new version (Unity > Animation) 0 Answers

Is it possible to manipulate Mecanim state machine / blend trees from scripting? 0 Answers

Created Animations only play half within Animator 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