• 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 CallToAdventure · Apr 09, 2012 at 09:10 PM · rotateparent

Sync speed (fake stuff)

Here's an interesting problem I cannot find an approach to : I want to parent an object to a rotating wheel; but - as the child object is instantiated on the panel at a given position I want it to rotate with the panel AND keep its orientation (it's a shadow); like a hanging cloth pinned on the edge of a wheel - it rotates with it but due to the gravitation, it still keeps its .. verticality. See, my native language not being english I cannot put th problem into proper terms hence I cannot find or a solution.

I made it well so far - the only hiccup being that I cannot seem to sync the speed - to "fake" it perfectly. It always goes really fast so I had to slow it down but later on, when the speed increases it becomes visibly out of sync.

 var wheel:Transform;
 function Update () {
     var ShadowSync= wheel.GetComponent(level)._speed;
     transform.Rotate(Vector3.forward, ShadowSync/100);
 
 }





Comment
Add comment · Show 1
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 CallToAdventure · Apr 09, 2012 at 10:21 PM 0
Share

Forgot to mention one thing - the wheel increments its speed with each level. $$anonymous$$aybe I should look into that.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Owen-Reynolds · Apr 10, 2012 at 02:54 AM

A cheap fix is to child an empty to the wheel. That will give the location for your shadow. Then have the cloth script put itself there:

 // on shadow:
 Transform mountPoint;

 // Not so sure about this line:
 mountPoint = GameObject.Find("wheel").transform.Find("childEmpty"); // start

 // in update. Put at rotating mountpoint:
 transform.position = mountPoint.position;
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

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

Rotation script ineffective on objects with children 0 Answers

How can I make particle textures rotate with parent? 0 Answers

Make a simple tree 1 Answer

How do I parent something, but still let it rotate? 1 Answer

A way to rotate object 90 degrees when it becomes child of parent? 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