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 mccosh · Mar 13, 2013 at 12:34 AM · animation

How to have an object mimic another's animation

Hey everyone,

So I have two objects, right now I'm just using the default construction worker in the Character Controller asset package, and I want them to behave in the exact some way at all times. What I mean by this is one of the characters will be controlled by the player and will behave normally. The second one should simply copy the position, rotation, and animations of the first character.

I am currently able to update the position and rotation in real time accurately simply by doing

 obj2.transform.position = obj1.transform.position;
 obj2.transform.rotation = obj1.transform.rotation;
 

but I cannot do that with the animation component. All I've been able to do is stick the ThirdPersonController onto both objects which is not something I really want to do.

So is there a way that I can update an object to mimic the animations of another in real-time, assuming all the possible animations are known ahead of time?

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 Benproductions1 · Mar 13, 2013 at 04:04 AM 0
Share

You shoudn't do position syncing, but animation syncing... don't set all positions and rotations to the same, ins$$anonymous$$d set all the animations to the same, it's easier and faster.

avatar image mccosh · Mar 13, 2013 at 04:07 AM 0
Share

Ok, but I'm not sure how to sync the animations hence the question. Do you know how to sync these animations or any resources that will help me figure it out?

avatar image Benproductions1 · Mar 13, 2013 at 04:14 AM 0
Share

I can't right now, but reading the documentation might be a good idea, figuring out how animations work: http://docs.unity3d.com/Documentation/ScriptReference/Animation.html

avatar image mccosh · Mar 13, 2013 at 04:23 AM 0
Share

I have looked through the documentation. Perhaps I'm just dense but I didn't see an easy or straightforward way to do it. The only thing I could think of is to save any function calls to the obj1's animation component and make the same calls to obj2's animation component which with my current setup would be awkward. Also I'm not sure if that would save me any time since I'm already doing this in a roundabout way by having a ThirdPersonController on both objects.

Also, as far as I know an animation doesn't actually move the players position so how will the second object mimic the movement/displacement of the first object if I only sync the animation?

avatar image Benproductions1 · Mar 13, 2013 at 08:19 AM 0
Share

You probably didn't understand it proerly, but you can loop through all animation states (as seen in the docs). You should be able to loop through one, and set it to the other :)

Show more comments

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

11 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

Related Questions

Can the animation editor create local rotational data? 3 Answers

Adding animation clips via script 2 Answers

Can I make animations snap to a frame? 1 Answer

How to select an animation clip by index number? 7 Answers

how to make this model and animation works 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