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 /
  • Help Room /
avatar image
0
Question by theterrificjd · Dec 09, 2017 at 11:47 PM · cameragravityaxiscamera rotate

CineMachine Freelook - X axis breaks when WorldUpOverride is sideways, any way to fix?

I have a ball moving along the inside of vertical circular track (like a ferris wheel). The gravity is set by the center of the wheel's position minus the ball's position (always pressing the player out).

I have a control transform for the ball that is set by the gravity orientation, and this sets the world up override.

However, as soon as the ball gets around the 90* vertical. While the camera still orients itself correctly, and up and down movement of the mouse still correctly adjusts the Y axis, the X axis becomes broken, doing some combination of freezing, clamping to almost no control, adjusting the Y axis instead, and inverting the controls.

Is there any way to fix this? Maybe the X axis is world-orientated and I can change it to be locally oriented somewhere? Or maybe with a simple controller script (detecting whether the player is upside down/sideways... and doing something? The axis inverting is the only thing I can think to fix with this, though, as I don't know enough of how cinemachine's rig turning works)

If not, I'll be switching to a custom camera controller and a camera rig built around the ball that detects the ground with raycasts to keep itself oriented properly... The only reason I don't want to do that is because there's so much power and control already in CineMachine, it'd be a waste not to utilize it.

Also, I have a custom extension script for a mouse scroll zoom. It adjusts the radius of the free look rigs. Is there a better way to have a mouse scroll zoom in the freelook camera that I may have overlooked? It works well enough, I am just curious as it seems like something that should be there.

I'd appreciate anyone taking the time to help me, I really want to be able to use CineMachine for everything and not have to try to make my own freelook camera controller as good as it is (except for this issue).

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 theterrificjd · Dec 12, 2017 at 12:21 PM 0
Share

This is sad because I have everything else working now, and I really need my camera working so I can start testing in earnest. So I'm now working on a temporary camera rig separate from Cinemachine until I can figure this out.

Hopefully somebody with some experience can pitch a moment of their time to help me figure this out.

I didn't mention in original post, the follow mode is a FreeLook: Simple Follow With WorldUp, and the WorldUpOverride is changed dynamically with script. I've tried the other sets (locked + variations), with different headings and all, but haven't figured out where the issue is yet.

avatar image mguidry · Jan 26, 2018 at 03:36 PM 0
Share

Did you find a solution to this? I have a similar issue with an entity walking around a sphere.

avatar image theterrificjd mguidry · Jan 26, 2018 at 08:22 PM 0
Share

Not with cinemachine, unfortunately. I created my own camera rig and script that accomplished the dynamic world up rotation with a camrig gameobject that follows the player and adjusts to my gravity accordingly.

The main thing you need to consider is that to create a Quaternion.LookRotation, you need up and forward directions. Up is obvious, but forward can be based on several different things. If it's a linear track, you know what forward is, otherwise you can calculate the forward by the most recent difference in the player's position, or using landmarks/gravity zones or some other solution. This is important to make sure the player's camera angle doesn't just jerk to a random direction as the gravity changes.

I'm still working on ways to improve it though, as I'm trying to get it to smoothly rotate as the player moves further along a bezier curve. It rotates fine, but not very smoothly. I plan to add a leading object and lerp/slerp towards the lead object.

And then whenever I have a cinematic camera effect, the script just flicks on the Cinemachine Brain and it does it's thing, then disables itself when its done.

Not the cleanest, but it works for what I'm doing right now.

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

160 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 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

Run script when camera has turned x amount degrees 2 Answers

My player doesn't rotate at the same time with the camera. 0 Answers

Help With Camera rotation on X and Y Axis (Target Focused) 1 Answer

viewing on the Mouse Y axis not working. 0 Answers

Using DampSmooth in EulerAngle is affecting the Position.Z value of the gameObject. 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