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 Zacitus · Apr 02, 2014 at 04:01 AM · rotationrigidbodyforcehierarchyjoints

How do I rotate the propellers on this drone?

Hello! I'm creating a game where the player can fly a drone around. I made an empty game object called "Drone" and placed all of the pieces together to make a body with wings and feet, and then made all the pieces children of the empty game object. I did some scripting and now I am able to move the drone in all directions and fly around.

alt text

So, here's where I'm running into an issue; I made a bunch of small propeller objects and I'd like to attach them to the wings so that when the player presses the spacebar to move up, the propellers spin (separately from the rest of the drone). I made the propellers and made them children of the empty Drone object, and added a script (only to the propeller "children") so they would rotate when the spacebar was pressed.

When I do this, however, it doesn't really work. It sort of made the entire drone rotate. This isn't what I want at all. Can anyone help me out? I've been trying to use joints but they just make the propellers fall off the drone or make the drone get stuck in the ground.

screen shot 2014-04-01 at 10.02.48 pm.png (225.4 kB)
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

Answer by whydoidoit · Apr 02, 2014 at 04:05 AM

You need another game object to be the propeller's holder. It needs to be positioned correctly and then the propeller is a child of it at local position 0,0,0. You can now rotate the propeller around it's local y axis to make it spin.

I wouldn't bother with a joint to make it break off, unless you really want a particular force level to make that happen. If you want the propeller to break due to some impact then give it a rigidbody set to isKinematic = true. When it collides with something you set the parent of the propeller to null and set isKinematic = false - perhaps providing it with some force based on it's current rotation (set its angular velocity to its spin rate and its velocity to the velocity of the drone).

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.

Follow this Question

Answers Answers and Comments

22 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 avatar image avatar image

Related Questions

How to rotate object about 2 axes (vertical y and depth z) using configurable joint. 0 Answers

Returning a rigidbody back to its original x and z rotations through physics forces. 2 Answers

Creating a joint based stab motion(going nuts) 1 Answer

relative velocity of rigidbody according to rotation... 1 Answer

Make object tip over 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