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 jason201 · May 11, 2013 at 05:22 AM · animation2dspriteanimations2d animation

Multiple Sprite animations

So I am wondering how I would implement a sprite sheet with multiple animations on it. Sofar I have this script that just goes from one offset to the other var uvAnimationTileX = 24; //Here you can place the number of columns of your sheet. //The above sheet has 24 var uvAnimationTileY = 1; //Here you can place the number of rows of your sheet. //The above sheet has 1 var framesPerSecond = 10.0; function Update () { // Calculate index var index : int = Time.time * framesPerSecond; // repeat when exhausting all frames index = index % (uvAnimationTileX * uvAnimationTileY); // Size of every tile var size = Vector2 (1.0 / uvAnimationTileX, 1.0 / uvAnimationTileY); // split into horizontal and vertical index var uIndex = index % uvAnimationTileX; var vIndex = index / uvAnimationTileX; // build offset // v coordinate is the bottom of the image in opengl so we need to invert. var offset = Vector2 (uIndex * size.x, 1.0 - size.y - vIndex * size.y); renderer.material.SetTextureOffset ("_MainTex", offset); renderer.material.SetTextureScale ("_MainTex", size); } The problem now is that I would like to make it so that I can have one row be one animation and the next row could be another animation so I could animate a sheet like this alt text

so I would really appreciate the help if someone would tell me how to do this. Thanks in advance.

Comment
Add comment · Show 6
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 jason201 · May 11, 2013 at 05:42 AM 0
Share

I notest that the image may not work so I am just going to post a linklink text

avatar image jason201 · May 11, 2013 at 04:38 PM 0
Share

I am not sure if this will bump but I will give it a shot

avatar image jason201 · May 11, 2013 at 06:38 PM 0
Share

bumpity bump

avatar image DannyB · May 11, 2013 at 07:10 PM 0
Share

Unikron's 2D Toolkit

avatar image jason201 · May 11, 2013 at 08:00 PM 0
Share

Like I said I don't have any money to spend

Show more comments

1 Reply

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

Answer by jason201 · May 12, 2013 at 12:18 AM

I fixed it.

What I did what have Two different plains with animated sprites then I wrote a code that would activate and deactivate the object depending on weather the character was moving or not.

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 rseye · Jul 22, 2013 at 02:15 PM 0
Share

Is this still the solution you are using or have you found a way to do it like you originally wanted, 1 animation per row in the sprite sheet? I'm trying to do just that and would like to find a solution for it, without replacing planes :P

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

15 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

Related Questions

Sprite Rect Moves Between Frames 0 Answers

How to show two 2D animations at the same time? 1 Answer

Animating a 2D character with this type of sprite 0 Answers

Running 2D Sprite Animation Once? 2 Answers

Animated Overlay Armor Sprite 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