What is the best way to prevent camera from going into ground. Currently using: CinemachineFreeLook

Hi all.

I am using a CinemachineFreeLook component for my game. It works great except the camera will goes into the ground if the ground behind the player is high. I am using mesh ground instead of terrain by the way.

I tried the “Cinemachine Collider”. It works well with walls but somehow cannot prevent the camera from going into the ground.

I then tried dynamically change the value of the bottom rig of the cinemachine base on the ground height. I had some trouble accessing the rig properties.

At this point, I am wondering what is the standard way of doing this? How to give the cinemachine camera a “collider” thing that works with the mesh ground. (if Cinemachine Colllider does the trick, then how do I configure it. I already set the layer right by the way.)

Thank you so much, everyone!

CinemachineCollider should work with the ground. Can you show some inspectors, and perhaps an image of the issue?

Thank you for the reply. It’s been a long time. I was pretty new to the forum so I could not find my own post and then I figured out the problem soon after the post. I then just forgot about this post.

Thank you again for offering help!

1 Like