first person camera Deformation with head movement?


If I put the camera on the head of a player as a child does not work well because the animation head is always moving with many movement animation

Is there a script follow head With rotation and position without animation

Thank you

You can make the camera follow the head by its transform.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class FollowHead : MonoBehaviour {

    public Transform head;

	// Use this for initialization
	void Start () {
	// Update is called once per frame
	void Update () {
        transform.position = head.position;
        transform.rotation = head.rotation;

Save as FollowHead.cs and attach to camera. Remove camera from the model. In the inspector, set “Head” to the head model (the one you are animating).

You can also add a position offset if the camera is improperly following the model.

Simply change line 16 to:

Vector3 offset =  new Vector3(0.5f, 0.5f, 0.5f);
transform.position = head.position + offset;

In this example the offset is 0.5 units (X, Y and Z).

i want camera follow head