I’ve made a 3rd person 3d camera that follows behind the player from 500 pixels away and is rotated using the mouse. i want to make it so that if the camera is colliding with an object, it will decrease its distance from the player until its no longer colliding with the object, then when the camera is clear of the object it will increase its distance until it gets to the set distance. the problem i have is that i can’t find a way to detect when the camera is colliding with something. I’ve tried to use 3d object as a camera collider but i cant find how to get the current position of the camera. can anyone please help?
I’ve kind of been able to figure it out, i used 3d raycast extension to cast a ray from the center of the camera and when the ray collides with an object, it will decrease the distance the camera is from the player until the camera is in front of the object, the new problem i have is that when trying to add the condition to move the camera back to its original position when not colliding with an object, it becomes jittery if the value is too high and is too slow if the value is too low.

Thanks for this, I’m going to try it
this has worked, thank you.
