playMaker

Author Topic: Puzzling Camera Y-Rotation issue  (Read 1710 times)

Breadman

  • Full Member
  • ***
  • Posts: 185
  • Derp
Puzzling Camera Y-Rotation issue
« on: March 28, 2014, 01:35:32 PM »
Whenever my character exits a Y-axis rotating platform, the camera slowly rotates on the Y axis.

My main camera is inside of a parent object called "camera holder". The main camera has basic smooth follow and zoom actions, it follows the character around. Its smooth follow action focuses on an invisible object called "camera aim point", parented to the character. I also have a simple two-state machine - clicking down the middle mouse button allows the player to toggle between "locking" the camera at its current Y-rotation, or controlling its Y-rotation with the mouse. Works great!

When the player enters a collider attached to a rotating platform, the character and the "camera holder" objects both become children of the platform. When the player exits, the character and the camera holder objects become unparented. This solution works really well with platforms that translate (and rotate), except for when the player EXITS the rotating platform as mentioned above. Hmm.

Used some scientific method to find out what's going on, and I'm totally confused. Upon exiting the platform:

+The "camera aim point" does not rotate or translate on its own, retains whatever position/rotation it had upon exiting the platform
+The "camera holder" does not translate or rotate on its own, retains whatever position/rotation it had upon exiting the platform
+The main camera's Y-rotation begins to change on its own after exiting the platform, despite its parent remaining stationary. The speed of this rotation changes randomly each time a spinning platform is exited.
+ Turning off the "smooth follow" action fixes the Y-rotation issue, which is odd because the object it is following (camera aim point) remains completely stationary and motionless after exiting the platform. Sadly, I need the smooth follow action so the camera can follow the character!

What's REALLY odd: Remember the option to lock/unlock the camera? In unlocked mode, the camera rotates based on mouse position, so upon exiting the platform, the camera doesn't have this issue - it just stays trained to the mouse. If the camera is in unlocked mode after exiting a platform, but the player switches to locked mode, the camera starts rotating! As soon as the player switches back to unlocked mode, the camera resets to where it was right before it was locked.

If anyone has any ideas, I'd love to hear them! Going crazy trying to figure this one out.

Breadman

  • Full Member
  • ***
  • Posts: 185
  • Derp
Re: Puzzling Camera Y-Rotation issue
« Reply #1 on: April 03, 2014, 08:59:15 PM »
For now, I have disabled the "camera lock" feature. so the camera is constantly trained to the mouse. This solves the issue temporarily.

I'm still curious if there's a way to solve the problem without constantly needing the mouse look action.