aim down sight script problem

Put this together, Need little help. the purpose of the script. Is you position the weapon camera (behind the sight) so it can appear your aiming.

using UnityEngine;

using System.Collections;

using System.Collections.Generic;



public class Gun : MonoBehaviour

{



	public GameObject weaponCamera = null;  // this weapon camera

    

 



        if (Input.GetButton("Fire2"))

        {

            if (weaponCamera)

            {

                weaponCamera.camera.enabled = true;

                mainCamera.camera.enabled = false;

            }

        }

        else

        {

            weaponCamera.camera.enabled = false;

            mainCamera.camera.enabled = true;

        }



	}

go on the wiki for unity 3d in there there is a aimind down script that does what you are trying to do. it’s good do

thanks for answering. I used it. doesn’t aim right down to the sight :face_with_spiral_eyes: going play around with it.

453902--15874--$sreenshoot.jpg