Skip to content

Fix Camera Clipping #36

@poetahto

Description

@poetahto
  • Player should not be able to move the camera inside certain colliders. For example, accidentally looking through the terrain.

You'll probably want to create a new script attached to the root player object that references the player camera GameObject (this is a child of Player/Yaw/Pitch transforms).

Once you have a reference to the player camera, you can raycast in it's direction, and if we hit a collider we move the camera closer to the player. Of course, the camera should return to some default distance given no colliders. We also want to allow some low-priority colliders to be ignored (see: trees, small rocks, ect.), so use layers to select the colliders that are considered in the raycast.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions