I’m not sure if I’m posing this question in the right forum, here goes…
I’ve been having troubles with my Third Person Controller, in which the character suddenly goes into half-jump pose and floats mid-air - I can no longer control the character apart from spinning it. Obviously, I figured the issue is with the setup of the character, the ridgebody, collider, etc. Then I realize this happened only when CinemachineCollider extension was in use and the line of sight of the character is obscured. That’s what triggers this weird behaviour.
Can you show something of your setup? I’d like to see the hierarchy for the controller, the Camera, and the vcam. You probably have some kind of feedback situation.
Sure!
I’ve placed the Third Person Controller prefab from the Unity Standard Assets in my scene, no modifications. Cinemachine> Create Virtual Camera.
I assigned the Third Person Controller that is in the scene to the Follow and Look At fields of the Cinemachine Virtual Camera script. I adjusted the follow offset and the aim a bit. It works totally fine up to this point.
Then, when I add the Cinemachine Collider extension - even without making a single change to the extension script, things get funky.
I spent more time than I’d like to admit trying to fix the same exact issue you were having: the Third Person Character would stay in the “Is Not Grounded” state indefinitely while a Cinemachine Collider was present in the scene. The issue lies with the Cinemachine Collider script. Under the hood, the Cinemachine Collider script instantiates a hidden dummy sphere collider Gameobject for future reference collision detections. While this wouldn’t be a problem under normal circumstances, the gameobject is instantiated at the maximum floating point value in all 3 axis, which I believe is causing Unity’s collision detection to go berserk. You need to edit CinemachineCollider.cs directly to fix this issue.
Find the following line:
@kirbyderby2000 Thanks for the feedback. The issue you mention was fixed a long time ago. Are you using a very old version of Cinemachine, perhaps the one from the Asset Store? If so, then you can upgrade to the latest via Package Manager.
Ah, good to know. I’m using Cinemachine 2.1.10. Also not sure if this matters but the project I’m working on happens to be made in 2018.3.0f2, too scared to upgrade my project to the latest version of Unity though haha.
Hey, just wanted to do an update saying that I had this issue too and was able to solve it by applying @kirbyderby2000 solution.
This was on Cinemachine 2.1.10 & Unity 2019.4.8f1.
WOW. Such a crazy coincidence. I haven’t used Cinemachine since I last posted in this thread… until today - I put it to use. I’d nearly forgotten it existed!
I plan to resurrect this project, so I’m happy to see there’s a solution!
Hi i have same problem with unity 2020 and Cinemachine that i download form unitypackage manager . i dont have CinemachineCollider.cs script instead i see CinemachineColliderEditor.cs and CinemachineColliderPrefs.cs and none of them have that script you said what should i do ?
Do you have an asmdef file in your project? If so, you will need to explicitly add to it any package dependency assemblies, such as Cinemachine. As a test, you can try making an empty project and installing Cinemachine.