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 highpockets · Feb 15, 2014 at 08:00 AM · animationmovementoptimizationlerp

Lerp or animate?

Hey all,

I'm just curious if there is a best practice scenario for this movement that I'm doing on a custom GUI. To this point, I have not worked with any animation files as all of the movement is pretty basic in my game so far. As I'm designing my GUI, I have just completed an effect where a couple of directional arrows change position and rotation over time using Lerp on the floats of the rotation and position vectors and since the process is repeated every time that the character enters/exits these triggers, which is quite often, I was thinking that maybe it would be better to have an animation in memory. There would only be a single movement stored that I believe would be able to run in reverse when needed. Would this be a better approach for optimization than what I'm currently doing ( running 2 separate lerps (one for rotation and one for position) every time it needs to run )????

If an animation would be better, would it also be safe to assume that it would be better to use animations in place of some of my simple translations used on the child objects of my player ( which check their location every frame until they reach the target position ), since these translations are repeated time and time again???

Since it is a game for mobile devices, I'm just trying to find out where to draw the line in between memory consumption and processing overhead.. Since they are simple movements that only include 1 object at a time, is there really any performance gain since the animation is still processed??

Sorry if this sounds super novice.

Thanks

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

1 Reply

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

Answer by whydoidoit · Feb 15, 2014 at 08:03 AM

Well I use animations for those kind of effects because they are far more flexible than trying to work out all of the things you might change using Lerps etc. There appears to be no adverse performance in my games (mobile) for animations, but not really any significant benefit either (which probably depends on how well your Lerp/checking code is written).

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 highpockets · Feb 15, 2014 at 08:24 AM 0
Share

Great man, that's the kind of answer I was looking for. Thanks

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

19 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

Related Questions

Learning to move 1 Answer

Moving an object smoothly with a set distance and time 1 Answer

Moving 2D sprite along a path 0 Answers

Randomly moving bunny 2D 0 Answers

Moving with coroutines 2 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