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 Romano · Jan 23, 2015 at 01:28 AM · pivotsprite animation

Is it possible to move a transform to a specific point on a sprite animation every frame?

I've spent the past couple of days trying to figure out a way to move a transform to match a moving point on a sprite animation drawn frame by frame. The transform would move to a new point on the animation each frame so that the characters head can animate independently of the body.

Just wondering if anyone knows of any paid software or good tricks for achieving this? This locator system would be perfect: https://www.youtube.com/watch?v=69RT3g8HH3k but doesn't use the modern Unity animation system.

I've looked into using animation events but have found them quite difficult to work with/ unreliable so far.

Ideally I'm looking for something like the pivot in the sprite editor, but a whole separate one just for attaching child objects to each frame. I wouldn't mind doing some time-consuming typing in of offsets for each frame if it would work quickly enough.

Thanks very much!

Romano

EDIT:

My current solution is to use the sprite from the sprite renderer as a key in a dictionary which equals the desired point on the sprite as a vector2. It'll take ages doing it this way, and I don't know what impact checking the dictionary every frame of the animation will have on the performance so would still appreciate advice from anyone on how I can do this better.

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 carrollh · Jan 23, 2015 at 03:21 AM

That looks like he's just put some empty GameObjects as children of the main sprite GameObject. So when the thing moves they travel along. Then just tied a particle effect to each one.

You could create a custom Animation for each of these GameObjects that you could set to only last x frames. I'm not sure they would be perfectly timed though. To do that you would just select the GameObject for the foot, press ctrl+6 then add a new curve, and edit the keyframes. It sounds a lot harder than it is. Video tutorial for the Animation Panel: YouTube

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 Romano · Jan 23, 2015 at 03:29 AM 0
Share

It actually does look like he's done that! But each frame actually has its own different transform position, the example he's used is pretty bad at showing what its really doing.

$$anonymous$$aking separate animations themselves could be good, I'll give that a try thanks.

avatar image Romano · Jan 23, 2015 at 03:35 AM 0
Share

I hope you don't take this the wrong way, but you are a fucking wizard. Thank you! That worked instantly :)

avatar image carrollh · Jan 23, 2015 at 03:54 AM 0
Share

Ha! Glad I could help :)

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

Changing the pivot point of meshes. 12 Answers

pivot not exporting 0 Answers

How to get distance from position to transform bounds 1 Answer

Animation rotation problem. 0 Answers

Simple LookAt Rotation with offset pivot 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