• 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 so_troll · Aug 30, 2014 at 06:38 PM · 2dspritespriterenderer

Dragging a sprite into an animation not working

I am modifying the 2D sidescroller template and I am having a problem. My main character is an object named protagonist. INSIDE this is another gameobject called body. protagonist does not have a sprite renderer, but body does. I want to modify an animation. So I pick an animation, let's say, "Jump". I go to the animator timeline and select that the body sprite renderer sprite needs to be changed. I drag in the appropriate sprite, the sprite of the character jumping, and the Animator somehow magically creates a protagonist->sprite property, instead of just changing the body->sprite property. I don't understand this. It literally creates a sprite renderer on the protagonist when all I want to do is change the sprite of the sprite renderer on the body. I have no idea how I am supposed to do this. Please help me because this is driving me insane. Thank you so much for your help.

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 so_troll · Sep 02, 2014 at 07:01 PM 0
Share

I would really appreciate if someone could update me on this. Is this a bug? Do I need to hold down a special key? Surely someone else has run into this problem...

avatar image froYo · Sep 02, 2014 at 07:34 PM 0
Share

If you could provide some screenshots of where exactly you're dragging the sprite, your animation and of what your protagonists setup is. Hopefully it will be easier to help you, it's hard to understand exactly what you're doing just though text :)

avatar image KMKxJOEY1 · Sep 02, 2014 at 07:37 PM 0
Share

" I drag in the appropriate sprite, the sprite of the character jumping, and the Animator somehow magically creates a protagonist->sprite property, ins$$anonymous$$d of just changing the body->sprite property." What does this mean? Where are you dragging in this sprite? And I'm assu$$anonymous$$g it is a 1 sprite animation?

3 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by Fohristiwhirl · Sep 02, 2014 at 08:20 PM

Does the child GO have both a sprite renderer and animator component? also the animation clip that you created in the animation window is that hooked up to the animation controller?

You can't drag animation clips onto a game object. The sprite renderer displays only one sprite at a time, the animation changes the sprite the renderer is displaying in the correct order at a steady rate to simulate movement.

I created a test project. Created two empty GO's called one protagonist and one sprite. Made sprite a child of Protagonist. Added a sprite renderer and animator component to sprite. Dragged a demo sprite onto the Sprite field of the sprite renderer. By this point I had a static sprite appearing in the scene view.

Next I created an animation clip and animation controller. I assigned the animation controller to the controller field of the animator component on the sprite GO. I set the default state of animation in the mechanim animator window to the animation I made. Now when i press play the sprite animates correctly.

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
3

Answer by Gandalf_The_Black · Oct 10, 2017 at 05:50 PM

Hey, I'm over 3 years late, but nevermind. I was really confused for ages over this. Then I realised that all I had to do was drag it to the column on the left side in default view. Huh.

Comment
Add comment · Show 3 · 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 lisandroguevara210 · Oct 31, 2018 at 01:07 PM 0
Share

O$$anonymous$$EGALUL, THATS IT THAN$$anonymous$$ YOU!

avatar image kn932055 · Jan 10 at 02:14 PM 0
Share

But I feel there is a problem in doing that like in my case. I hade to create a new animation by clicking on create new clip to solve this issue after selecting the player from scene view

alt text

output-onlinepngtools.png (58.0 kB)
avatar image kn932055 kn932055 · Jan 10 at 02:15 PM 0
Share

Then I was able to drag and drop without any issue

avatar image
0

Answer by danrayson · Oct 03, 2018 at 08:37 PM

Late also, but I just realised that it had to be an actual GameObject, not just a Prefab!

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.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

9 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Ray effect on sprite with obstacles 0 Answers

renderer.enabled doesn't work but coloring does 1 Answer

Crop/Mask a Sprite on runtime 0 Answers

How to get the bounds of an actual sprite, not it's bounding box. 1 Answer

Why is my sprite not the original resolution? 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