LookAtPlayer
A class in Root.Township, the global namespace.
Client: turns its object to face the local player's head every frame, smoothly, with an optional height adjustment.
- Listed in Global namespace: I to L
- Inherits or implements
MonoBehaviour
Constructors
| Member | What it is |
|---|---|
LookAtPlayer() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
8 private and internal fields
Methods
4 private and internal methods
| Member | What it is |
|---|---|
private void Awake() | Caches the transform, start local position and rotation. |
private void LateUpdate() | Blends toward facing the local player by interpolation. |
private void OnEnable() | Snaps to face the local player, or disables itself if there is none. |
private Quaternion PositionAndGetRotation(PlayerController controller) | Resets the local position, optionally moves it up or down toward head height, and returns the rotation facing the head. |