11000+款5星资源

8.5万+用户参与评分

10万+社区成员鼎力支持

每款资源都经过 Unity 审核

首页
工具
镜头
此内容由第三方提供商托管,该第三方提供商在未接受Targeting Cookies的情况下不允许观看视频。如果您想观看来自这些提供商的视频,请将“Targeting Cookie”的Cookie偏好设置为“是”。
1/2
The CameraController script provides comprehensive camera movement, rotation, and zoom functionality for a Unity project in both 2D and 3D environments.
可编程渲染管线(SRP)兼容性
Unity可编程渲染管线(SRP)是让您能够通过C#脚本控制渲染的一个功能。SRP是支撑通用渲染管线(URP)和高清渲染管线(HDRP)的底层技术。
Unity版本内置渲染管线通用渲染管线(URP)高清渲染管线(HDRP)
6000.0.29f1
兼容
兼容
兼容
描述

This script controls the camera in a Unity scene, enabling users to move, rotate, and zoom using customizable key bindings. It offers the flexibility to:

  • Pan the camera using keyboard inputs or screen edge panning with mouse control.
  • Rotate the camera around a defined pivot point or around its own position.
  • Zoom in and out with assigned key controls.
  • Limit camera movement within a defined boundary range for each axis (X, Y, Z).
  • Provides an optional pivot for rotating around specific points in 3D space.
技术细节
  • Movement Modes: Supports movement via keyboard keys (W, A, S, D) and mouse edge panning (customizable border thickness).
  • Rotation: Handles free or pivot-based rotation, customizable via key inputs (Q, E, R, F for different axes).
  • Zooming: Zooms in and out based on key inputs (Z, X) and limits zoom range by Y-position.
  • Speed Controls: Includes configurable movement speed, rotation speed, and zoom speed.
  • Boundary Clamping: Ensures the camera stays within set movement boundaries defined by minX, maxX, minY, and maxY.
  • Pivot Point: Optionally supports rotation around a specified pivotPoint transform, otherwise rotates around its own position.
  • Key Bindings: Each action (movement, rotation, zoom) can be independently enabled or disabled and configured with specific keys, including custom controls for vertical movement in 2D games.
  • Collision-Free Movement: The script does not handle collisions but can be adapted to prevent the camera from passing through objects by adding collision detection code.

Key Fields:

  • canKeyPan, canMousePan, canRotate, canZoom: Toggles for enabling/disabling movement, rotation, and zoom functionalities.
  • moveForward, moveBackward, etc.: Key bindings for camera movement and actions.
  • panSpeed, rotationSpeed: Control the speed of the camera's movement and rotation.
  • minX, maxX, minY, maxY, minZ, maxZ: Boundaries to constrain the camera's position.
  • pivotPoint: Optional point around which the camera can rotate.

This script provides versatile camera control mechanics that are essential for many Unity-based projects, offering both flexibility and ease of integration into various game types.

Universal Camera Controller (2D and 3D)

(暂无评分)
2 users have favourite this asset
(2)
$15
席位
1
更新的价格和增值税在结算时计算
退款政策
该资源受Unity资源商店退款政策约束。有关详细信息,请参见《最终用户许可协议》(EULA)中的第2.9.3节。
安全结账方式:
Supported payment methods: Visa, Mastercard, Maestro, Paypal, Amex
许可证类型
文件大小
180.3 KB
最新版本
1.0
最新发布日期
2025年3月4日
原始 Unity 版本
6000.0.29
高品质资源
11000+款5星资源
深受用户信赖
8.5万+用户参与评分
强大的社区支持
10万+社区成员鼎力支持
Unity logo
语言
反馈
合作伙伴计划
合作伙伴
USD
EUR
Copyright © 2025 Unity Technologies
所有价格不包含税
USD
EUR
$15