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 Chats · Jun 17, 2014 at 02:32 PM · rotationeulerangleslocalrotation

How to set an exact Local angle.

I'm by no means a rookie programmer but this problem has plagued me for months and i've worked around it but never really solved it, I've got a dropship and the thrusters on the side rotate, I want to set there angle to the current speed of the dropship and for them to just rotate around there mid point, ideally i would love it to just be transform.rotation.x = dropship.CurrentSpeed. So far using euler angles i havent managed to get it to work. I should add also that the thrusters are children of the main air frame of the ship which rotates serperately as well. Cheers!

PS to clarify i want the angle set to the speed of the ship, so if it is moving at a constant speed they will not be rotating.

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 Olgo · Jun 17, 2014 at 03:10 PM 0
Share

Could use more detail to fully grasp your question. In what way do the engines rotate? Is it a sort of harrier jet type motion? The jets point towards the ground when it is stationary but slowly rotate to adjust thrust to the back of the craft as it comes to speed?

Also, why would the speed of the ship equal the rotation of the engine?

Seems like you would want to set the rotation to the acceleration of the craft, not the speed.

I try to avoid Euler angles whenever possible, I dont fully understand them yet.

avatar image RetepTrun · Jun 17, 2014 at 03:25 PM 0
Share

So you want the rocket flames pointed down when hovering, horizontal when flying forward and all the in between?

How about

 -define 2 rotations, one fwd one up
 if (velocity.magnitude>1){
    slerp to fwd rotation using velocity.magnitude/7 as 3rd      parameter
 }
 else
    slerp to vertical

avatar image robertbu · Jun 17, 2014 at 03:27 PM 0
Share

I'm fuzzy here about how they rotate, but say they rotate on their local 'z' axis. You can do:

  transform.localRotation = Quaternion.AngleAxis(speed * factor, Vector3.forward);

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Bike stay upright based on surface normal 1 Answer

Why is my object's local x rotation not going past 90 degrees? 1 Answer

Code to rotate around a local axis until local Y is 0? 0 Answers

Complicated Rotation Issue 1 Answer

how to apply overall rotation to collection of rotated objects 0 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