I’ve got a scenario imported from the 3ds max and i’m using the 3rd Person Controller that comes with the standard assets and for the camera the MouseOrbit script.
Everything was running nice, now i updated my camera script to the MouseOrbit Improved script that has camera collision, the problem is that when i start the game and move my character the camera starts to collide with nothing… lol there is nothing between the Linecast from the Camera to the character but it collides lol.
Does anyone experience this kind of problem?
I can’t find what the problem is.
Why don’t you just use the version of Physics.LineCast which has a RaycastHit out parameter, and print out the name of the gameObject you’ve hit? That should let you find out what is going on.
if( !hit.collider.CompareTag("Player") ){
distance -= hit.distance;
}
but still don't understand why the Physics.Linecast has to collide with the end position
According to the documentation, Physics.Linecast is non-directional. It returns any collider between the two end points. Why not use Physics.Raycast, with a distance? (and with out hitinfo so you can ignore the player if that’s necessary).
I just use the regular URP Lit shader, and yes it is just a single camera.
I just use the regular URP Lit shader, and yes it is just a single camera.
– ILikeGreenDev