Hello everyone, first time poster since almost all issues that I have had in the past were easily resolved with a quick google or forum search.
I have recently switched to Cinemachine as oppose to just making the camera a child of the player. Everything was working fine, unitl recently, without any settings changes that I can just undo, the camera just randomly switches to looking at the player from the opposite position. Sometimes it stays like that, sometimes it lasts for 0.1 seconds. I have only one virtual camera in the scene, so this is not related to blending or transitioning from one camera to another. The same camera just flips. Does anyone know what I can do. I will post screenshots of this random flip to provide more context. The biggest problem is that this happens 100% randomly. It is not consistent. Sometimes it never happens, sometimes it happens once in the level, sometimes multiple times, very rarely in the same spot in the level. I have googled for hours with no results.
Thank you in advance!
Hmmm… it all looks pretty normal.
Does the flip happen in a single frame, or does the camera damp its way around?
Can you show an image of the CM Brain inspector too?
Are you doing anything weird with the target’s rotation? Or the world up override?
I will post the player settings also just in case, along with this link: Imgur: The magic of the Internet where you can see the recorded footage of this issue. I was lucky to capture it happening both for 0.1 seconds as I described, AND changing and staying that way. Hope it provides some insight. As for the target’s rotation, not that I know of
aahh! You are doing something with the player rotation: it’s turning upside-down, which makes its forward face backwards. Since you’re binding to target’s local rotation, your offset flips around relative to the world, but stays constant relative to the target. Try changing the binding mode to World Space.
You are a god. That fixed it! Thank you soo much! I’ve played through the level multiple times trying to find the spots where it flips most often but the issue didn’t show up, not even once!
Hi, changing the binding to world space stops the camera from rotating along with the target’s rotation. Is it possible to prevent the 180° turning while maintaining the rotation feature? (In my case I’d only need the camera to rotate along with the target’s y rotation)
I’m using it, but when my target’s (which is also the “look at”) x rotation reaches 180°, the camera goes to the opposite point. I’d like the camera to follow along with the y rotation, is there any workaround? The result i’d like to achieve would be a mix between “simple follow with word up” and “lock to target with world up”
I think the best way to deal with this would be to create an intermediary invisible object to use as camera target. Give it a custom script so that its position exactly matches the player position, and its rotation matches but with up pointing up. You’ll have to work out a strategy to handle the situation illustrated (maybe forward can be held over from previous frames, before the x rotation became 90). Use the invisible object as camera target instead of the player.