Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 LHP · Mar 11, 2010 at 03:25 AM · animationiphonetrees

Swaying trees on iPhone?

Hello, I am wondering if it is possible to get trees I add as GameObjects in Unity Iphone to sway similarly to the way they do when added with the terrain editor in regular Unity. I'm assuming I would have to create some animation, but I haven't the slightest clue on how to begin doing something like that.

Any help is appreciated, Thank you!

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

3 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by equalsequals · May 31, 2010 at 03:12 PM

In addition to what @Jaap Kreijkamp and @Paulius Liekis are saying -

Create a bone rig and skin your tree mesh to it. Use as few bones as possible, as the large trunk and thicker branches most likely will not bend unless it's hurricane-grade wind.

The most efficient way to animate things on the iPhone is via animation clips (as per performance tests by the creator of Zombieville USA).

Additionally, yo make it as efficient as possible you want to make sure that your tree's all have a shared material so that batching will come in and clean up some draw calls.

Unity iPhone does not support animation culling so you may want to take it into consideration that even trees outside of the camera's frustum will continue to update their animation even when not rendered.

Hope that helps.

==

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 Jaap Kreijkamp · Mar 11, 2010 at 03:32 AM

The easiest way to have them just animated, but other solution is to just give them bones and have them updated through code (if you've got many trees this could impact performance). The animation could be kept simple by having only a few bones for the stem, but depending on the kind of leaves you have it would work better to have a few bones for the leaves as well to have them sway independently from the stem. Keep the movement subtle, so it's less obvious it's an repeating animation. To improve the realism of the effect you could start animation based on position (so for example, add an transform.postion.x * windspeed delay before starting the animation).

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 Paulius-Liekis · Mar 22, 2010 at 08:52 AM

It's done using one bend-matrix per tree and shaders in regular Unity. You can't use such complicated shaders on iPhone, but you could skin your tree to two bones and then control them either using animation or manually. But in reality I doubt that you can do that - 10-15 trees it will eat all you processing time on iPhone ;) I wouldn't do that unless the trees are main characters in the game ;)

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

Pitfalls for characer/animations on the iPhone 1 Answer

Ani.Mate error when port a PC game to iPhone 2 Answers

Can I make animations snap to a frame? 1 Answer

Fruit Ninja - Cut fruit effect 3 Answers

How to achieve best fps for Animating - Built-in Unity animation or coded through Javascript? 1 Answer


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