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 jim_dodge · Feb 25, 2014 at 10:07 PM · animationspritemechanim

How do I call sprites from spritemaps frame by frame using Mechanim? Is there another solution?

I would like to call some of my environmental animations frame by frame so that the environment tiles can be synchronized in the same animation state and cycled at irregular intervals en masse. I have written code to do this using a state machine that alternates the value of one bool from true to false with each step in the animation (eg. bool = true goes from frame one to frame two, and then waits until bool = false to go from frame two to frame three). I have used similar strategies to cycle between 3d animations (although the bools changed because of user input not time - both are code driven, so this should not matter), however, neither blend trees nor states allow me to switch between individual sprites using one bool. The animator does not appear to provide answers, but I am much less familiar with that than I am with Mechanim so there could be a solution with that tool which I am currently unaware of.

I have a "Motion" based on a Spritemap that cycles perfectly, but does not allow the behaviour I desire. Possible (hacky) solutions include: 1) I could create individual "Motions" with one frame of each animation and cycle between single frame "Motions" using my current code 2) Do the same thing with "Motions" and use blend trees (1D) and change the code to increment a float that blends between sprites

OR if anyone knows a better solution I am open to using Animator, rewriting my code, or doing Spritemaps manually to get frame by frame control

FYI: I am not displaying any individual sprite for less than five frames, but my code allows me to change the sprite any frame after that

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

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

20 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

Related Questions

Mechanim animation blend tree problem 0 Answers

2D Animation. Changing to sprites with different pivots. 0 Answers

How do I stop sprite animation on last frame? 2 Answers

Shaking Sprite Mechanic/Animation after being hit 0 Answers

Most efficient way to do 2D animation 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