Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 DasCoconut · Jun 30, 2017 at 05:45 AM · rotationscripting problemrigidbodyquaternionspin

How to "spin" a ring, but not rotate it?

Hi folks. Newbie stuck in Quaternion land at the moment. The base mechanic I'm trying to implement is flying through a ring in a rail-shooter environment, a la Star Fox 64. I'm stuck on a particular piece of visual flair - getting the rings to spin on an axis instead of rotate around x, y, z angles.

For a visual, I'm trying to replicate the behavior seen on the yellow and blue rings from the Training Level. The hole the plane flies through remains fixed, but the ring spins in place.

The problem I have is that every time I try to modify the rotation, I end up rotating the ring in place around the roll, pitch or yaw - not spinning it around a center point. I've stumbled through some of the Quaternion methods, but can't seem to find one that suits my needs.

Has anyone else solved this problem or could point me to a resource that would help? You suggestions are greatly appreciated!

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 Masterio · Jun 30, 2017 at 06:37 AM 1
Share

I understand you need center a pivot on these objects. So you can achieve this with 2 ways:

  1. Prepare good pivoted ring objects.

  2. Create transform parent and pivot it manually by positioning it inside the parent transform. Then rotate a parent transforms ins$$anonymous$$d ring object.

1 Reply

· Add your reply
  • Sort: 
avatar image
2
Best Answer

Answer by tanoshimi · Jun 30, 2017 at 06:58 AM

Tip: You hardly ever need to directly manipulate quaternions - do everything in Euler angles which are simply to manipulate and visualise.

The example you've shown is a simple rotation around the z axis, with a pivot in the centre of the ring model. If that's not the result you're getting, it may be helpful if you post a video of what's going wrong.

Comment
Add comment · Show 1 · 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 DasCoconut · Jun 30, 2017 at 01:47 PM 0
Share

Agreed on the direct manipulation of quaternions... I found that one out the hard way. The Euler angle manipulation is what I was getting stuck on.

At your suggestion, I made a quick video of what I was experiencing - and @$$anonymous$$asterio 's comment of "prepare good pivoted ring objects" sparked the thought to try the built in rotational tool. (Don't know why I didn't try that from the start).

So the good news is that I had the pivot in the center already, and the bad news was that I didn't have the initial angles set properly to make the simple rotation along one axes. Rotational tool fixed the orientation for me (y from 0 to -90, z from 180 -> 270) and aligned the model with a single axis that I should now be able to change via scripting.

Thank you for your 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

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

Related Questions

How to set a limit for my player rotation ? 0 Answers

Finding A Rigidbody's Rotation Speed And Direction 2 Answers

Player character X rotation going haywire on game start 1 Answer

Rotating Rigidbodies 2 Answers

Alternative to Quaternion.LookRotation() ? 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