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 SpencerRiedel · Jan 06, 2018 at 04:19 AM · rotationchild objectparent transformgimbal-lock

Just updated to 2017.3.0f3 And my moving platforms are locking my character's rotation

I'm making a 3D platformer. I've been using the standard setup for moving platforms. When the character lands on a platform, they become a child object to the platform, and follow it.

This was working perfectly through several Unity versions up until 2017.3.0f3. Now, when the character lands on the platform, their rotation is fixed to whatever it was when they landed. So if you land facing forward, relative to the camera, you're stuck facing forward until you get off the platform.

Here is my code that finds the camera relative rotation for the player:

     private void ComputeRotation()
     {
         Quaternion inputDirection = Quaternion.Euler(0, (Mathf.Atan2(LSX, LSY) * Mathf.Rad2Deg) + CameraObject.transform.rotation.eulerAngles.y, 0);

         if (new Vector2(LSX, LSY).magnitude > 0f) //If the User pushes the joystick beyond a deadzone
         { //Rotate the character to face the direction the joystick is being held relative to the rotation of the camera

             Direction = (Quaternion.Slerp(Direction, (inputDirection), Time.deltaTime * TurnRate * turnSpeed));
 
             inputTransformDifference = Mathf.DeltaAngle(inputDirection.eulerAngles.y, transform.rotation.eulerAngles.y);
 
             inputTransformDifference = Mathf.Abs(inputTransformDifference);
         }
 
     }

This is where that rotation is applied:

 public void Rotate(Quaternion rotation)
 {
     rigidbody.rotation = rotation;
 }

and to set the parent:

         groundable.SetParent(collision.transform);

(groundable is the name of an interface)

I haven't the foggiest idea why this might have broken. I don't think this is gimbal lock, because the platforms aren't rotating, and when I did have rotating platforms cause gimbal lock, that could be temporarily remedied by re-instantiating the pre-fab, which hasn't fixed this issue.

Thanks for any thoughts you have

UPDATE: I rolled back to 5.6.5f1, and it un-broke, so I know it's the version that broke it.

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
0
Best Answer

Answer by SpencerRiedel · Jan 07, 2018 at 01:05 AM

Looks like Unity's new version of PhysX disables local-space physics. I'm told it's much more performant. I'm happy that physics is getting a little leaner though it will mean some work is necessary to re-implement moving platforms

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

98 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

Related Questions

How would you set a camera lerp position with code not a child object? 1 Answer

Reverse rotations problems... 2 Answers

when i make a gameobject child of another gameobject, then it's scale and rotation both changes in a very wierd manner. 0 Answers

Importing from blender adds gimbal locks 0 Answers

UNET Rotation of Child transform 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