- Home /
Player have to stop when hit a corner
Good afternoon, I'm developing a game where the player can only move to the right and left by the controls, for him to go back and forth, it is necessary to "spin" the screen and then continue to the right or left ... But my problem is this: the camera only turns 90 in 90 degrees, but as the collider player is a box when he hits the corner of some other box, it turns and lose control of the camera ... how can I do him not spin when hitting the corners, just stop? I tried to make the player stop raycast, but as the raycast is centered on the player, it does not always touch the object that is in front of you. Thank you!
Comment