My first person camera is weird after enabling collider?

Hello,
I have a first person script, and it work good, but however if i enable another collider, then it acts all crazy?
also i have tried disabling the script of the first person camera, and then the crazy movement stops, but when i enable it again it goes again. Meaning that it not a collider issue.
Here is a GIF of the problem
And here is the script of the first person camera :

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

public class ScanningRobotTestCamera : MonoBehaviour {
	//ThirdPersonCamStuff VVVVVVVVVVVVVVVVVVVVVVVVVVVV
	public const float Y_AXIS_MIN = 0.00f;
	public const float Y_AXIS_MAX = 50.00f;
	[Space]
	[Header("ThirdPlayerCamStuff")]
	
	public Transform LookAtTarget;
	public Transform CameraTransform;
	
	private Camera cam;
	
	public float Speed;
	public float distance;
	public float currentX;
	public float currentY;
	public float sensetivityX;
	public float sensetivityY;
	public bool Once;
	public bool SecondOnce;
	//ThirdPersonCamStuff ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
	//FirstPersonCamStuff VVVVVVVVVVVVVVVVVVVVVVVVVVVVVV
	[Space]
	[Header("FirstPlayerCamStuff")]
	public float ClampFirstPersonMin;
	public float ClampFirstPersonMax;
	public GameObject Arms;
	public GameObject RobotModel;
	public GameObject PlayerMdel;
	
	public Vector2 MouseLook;
	public Vector2 SmoothV;
	public float sensitivity;
	public float smoothing;
	public Vector2 md;
	public bool Escape;
	public GameObject Character;
	public GameObject NormalParent;
	//FirstPersonCamStuff^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
	
	[Space]
	[Header("Other")]
	public string ChangeCamsKey;
	public int DiffrentCamsNumber;
	public int NumberOfDiffrentCams;
	public enum DiffrentCams{FirstPerson,ThirdPerson};
	public DiffrentCams DiffCams;
	
	// Use this for initialization
	void Start () {
		
		CameraTransform = transform;
	}
	
	
	
	
	
	
	
	
	void Update(){
		if (Input.GetKeyDown(ChangeCamsKey)){
			if (DiffrentCamsNumber == NumberOfDiffrentCams){
				DiffrentCamsNumber = 0;
			}
			DiffrentCamsNumber += 1;
			if (DiffrentCamsNumber == 1){
				DiffCams = DiffrentCams.FirstPerson;
			}
			if (DiffrentCamsNumber == 2){
				DiffCams = DiffrentCams.ThirdPerson;
			}
		}
		
		
		
		
		
		//FirstPersonCamStuff VVVVVVVVVVVVVVVVVVVVVVVVVVVVVV
		if(DiffCams == DiffrentCams.FirstPerson){
			Arms.transform.parent = transform;
			RobotModel.GetComponent<MeshRenderer>().shadowCastingMode = UnityEngine.Rendering.ShadowCastingMode.ShadowsOnly;
			if(!SecondOnce){
				//				transform.localEulerAngles = Vector3.zero;
				Arms.transform.localEulerAngles = new Vector3(0,0,Arms.transform.localEulerAngles.z);
				SecondOnce=true;
			}
			Once=false;
			gameObject.transform.parent = Character.transform;
			gameObject.transform.localPosition = new Vector3(0,2.6399991f,0);
			md = new Vector2(Input.GetAxisRaw("Mouse X"),Input.GetAxisRaw("Mouse Y")); 
			print (md);
			md = Vector2.Scale(md,new Vector2(sensitivity * smoothing, sensitivity * smoothing));
			SmoothV.x = Mathf.Lerp (SmoothV.x, md.x, 1f / smoothing);
			SmoothV.y = Mathf.Lerp (SmoothV.y, md.y, 1f / smoothing);
			MouseLook += SmoothV;
			MouseLook.y = Mathf.Clamp (MouseLook.y, ClampFirstPersonMin,ClampFirstPersonMax);
			Arms.transform.localPosition = new Vector3(-1.85f,-2,1.31f);
			transform.localRotation = Quaternion.AngleAxis (-MouseLook.y, Vector3.right);
			Character.transform.localRotation = Quaternion.AngleAxis (MouseLook.x,Character.transform.up);
		}//FirstPersonCamStuff^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
		//ThirdPersonCamStuff VVVVVVVVVVVVVVVVVVVVVVVVVVVV
		if(DiffCams == DiffrentCams.ThirdPerson){
			Arms.transform.parent = PlayerMdel.transform;
			RobotModel.GetComponent<MeshRenderer>().shadowCastingMode = UnityEngine.Rendering.ShadowCastingMode.On;
			Arms.transform.localPosition = Vector3.zero;
			if(!Once){
				MouseLook.y = 0;
				Arms.transform.localEulerAngles = Vector3.zero;
				Once=true;
			}
			SecondOnce=false;
			gameObject.transform.parent = NormalParent.transform;
			
			transform.localRotation = Quaternion.AngleAxis (-MouseLook.y, Vector3.right);
			//		Character.transform.localRotation = Quaternion.AngleAxis (MouseLook.x,Character.transform.up);
			if(Input.GetKey(KeyCode.Mouse1)){
				print(Vector3.back);
				currentY +=	Input.GetAxis("Mouse Y") * Speed;
				currentX +=	Input.GetAxis("Mouse X") * Speed;
				currentY = Mathf.Clamp (currentY, Y_AXIS_MIN, Y_AXIS_MAX);
			}}//ThirdPersonCamStuff ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
	}
	
	// Update is called once per frame
	void LateUpdate () {
		//ThirdPersonCamStuff VVVVVVVVVVVVVVVVVVVVVVVVVVVV
		if (DiffCams == DiffrentCams.ThirdPerson) {
			Vector3 dir = new Vector3 (0, 0, -distance);
			Quaternion rotation = Quaternion.Euler (currentY, currentX, 0);
			CameraTransform.position = LookAtTarget.position + rotation * dir;
			CameraTransform.LookAt (LookAtTarget);
		}//ThirdPersonCamStuff ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
	}
}

And here is the script of the player, Just in case :

using UnityEngine;
using System.Collections;

public class ScanningRobotTestPlayer : MonoBehaviour {
	public float Speed;
	public float JumpPower;
	[Range(0.1f,10)]
	public float CameraMoveSpeed;
	[Range(1,5)]
	public int CameraSensitivity;
	[Space]
	[Header("Input")]
	public string MoveUp;
	public string MoveDown;
	public string MoveLeft;
	public string MoveRight;
	public string Sprint;
	public string Jump;
	[Space]
	[Header("AttackSystem")]
	public GameObject RightArm;
	public float SizeOfArm;
	public float SizeSpeedingArm;
	public Collider ArmCollider;
	public bool ScaledArm;
	public bool TurnedOnScalingOfTheArm;
	public string KeyToAttack;
	[Space]
	[Header("Other")]
	public ScanningRobotTestCamera ThirdAndFirstPersonCameraObject;
	public bool Cursorlock;
	[Space]
	[Header("PrivateVariables")]
	private bool IsSprinting;
	private Rigidbody mybody;
	private Vector3 rot;
	private float OldSpeed;
	
	
	// Use this for initialization
	void Start () {
		ThirdAndFirstPersonCameraObject.Speed = CameraMoveSpeed;
		Cursor.lockState = CursorLockMode.Locked;
		mybody = gameObject.GetComponent<Rigidbody> ();
		OldSpeed = Speed;
	}
	
	
	
	
	
	
	
	
	
	
	
	// Update is called once per frame
	void Update () {
		if (ThirdAndFirstPersonCameraObject.DiffCams == ScanningRobotTestCamera.DiffrentCams.ThirdPerson) {transform.eulerAngles = new Vector3 (transform.eulerAngles.x, ThirdAndFirstPersonCameraObject.currentX, transform.eulerAngles.z);}

		Movment ();
		if (Input.GetKeyDown (KeyToAttack) && ThirdAndFirstPersonCameraObject.DiffCams == ScanningRobotTestCamera.DiffrentCams.FirstPerson){TurnedOnScalingOfTheArm = true;}
		if (TurnedOnScalingOfTheArm){IDIOTAnimation();}
		if (Input.GetKeyDown ("escape")){
			Cursorlock = !Cursorlock;
			if (Cursorlock = false){
				Cursor.lockState = CursorLockMode.Locked;
			}
			if (Cursorlock = true){
				Cursor.lockState = CursorLockMode.None;
			}
		}

	}

	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	void Movment(){
		if (Input.GetKeyDown(Sprint) && !IsSprinting){
			IsSprinting = true;
			Speed = OldSpeed * 2;
		}
		if (Input.GetKeyUp(Sprint) && IsSprinting){
			IsSprinting = false;
			Speed = OldSpeed;
		}
		if (Input.GetKeyUp(MoveLeft) && !Input.GetKey(MoveRight) || Input.GetKeyUp(MoveRight) && !Input.GetKey(MoveLeft)) {
			mybody.velocity = new Vector3(0,mybody.velocity.y,0);
		}
		if (Input.GetKeyUp(MoveUp) && !Input.GetKey(MoveDown) || Input.GetKeyUp(MoveDown) && !Input.GetKey(MoveUp)) {
			mybody.velocity = new Vector3(0,mybody.velocity.y,0);
		}
//		STRAIGHT
		if (Input.GetKey(MoveLeft) && !Input.GetKey (MoveUp) && !Input.GetKey(MoveDown)) {
			mybody.velocity = new Vector3(0,mybody.velocity.y,mybody.velocity.z);
			rot = transform.rotation * Vector3.left;
			mybody.velocity = new Vector3(rot.x*Speed,mybody.velocity.y,rot.z * Speed);
			mybody.velocity = mybody.velocity;
		}
		if (Input.GetKey(MoveRight) && !Input.GetKey (MoveUp) && !Input.GetKey(MoveDown)) {
			mybody.velocity = new Vector3(0,mybody.velocity.y,mybody.velocity.z);
			rot = transform.rotation * Vector3.right;
			mybody.velocity = new Vector3(rot.x*Speed,mybody.velocity.y,rot.z * Speed);
			mybody.velocity = mybody.velocity;
		}
		if (Input.GetKey(MoveUp) && !Input.GetKey (MoveRight) && !Input.GetKey(MoveLeft)) {
			mybody.velocity = new Vector3(mybody.velocity.x,mybody.velocity.y,0);
			rot = transform.rotation * Vector3.forward;
			mybody.velocity = new Vector3(rot.x*Speed,mybody.velocity.y,rot.z * Speed);
			mybody.velocity = mybody.velocity;
		}
		if (Input.GetKey(MoveDown) && !Input.GetKey (MoveRight) && !Input.GetKey(MoveLeft)) {
			mybody.velocity = new Vector3(mybody.velocity.x,mybody.velocity.y,0);
			rot = transform.rotation * Vector3.back;
			mybody.velocity = new Vector3(rot.x*Speed,mybody.velocity.y,rot.z * Speed);
			mybody.velocity = mybody.velocity;
		}
//		STRAIGHT
//		Curve
		if (Input.GetKey(MoveUp) && Input.GetKey (MoveRight) && !Input.GetKey(MoveLeft)) {
			mybody.velocity = new Vector3(mybody.velocity.x,mybody.velocity.y,0);
			Vector3 LeftTopCorner = Vector3.forward + Vector3.right;
			rot = transform.rotation * LeftTopCorner;
			mybody.velocity = new Vector3(rot.x*Speed,mybody.velocity.y,rot.z * Speed);
			mybody.velocity = mybody.velocity;
		}
		if (Input.GetKey(MoveUp) && !Input.GetKey (MoveRight) && Input.GetKey(MoveLeft)) {
			mybody.velocity = new Vector3(mybody.velocity.x,mybody.velocity.y,0);

			Vector3 LeftTopCorner = Vector3.forward + Vector3.left;
			rot = transform.rotation * LeftTopCorner;
			mybody.velocity = new Vector3(rot.x*Speed,mybody.velocity.y,rot.z * Speed);
			mybody.velocity = mybody.velocity;
		}
		if (Input.GetKey(MoveDown) && Input.GetKey (MoveRight) && !Input.GetKey(MoveLeft)) {
			mybody.velocity = new Vector3(mybody.velocity.x,mybody.velocity.y,0);
			Vector3 LeftTopCorner = Vector3.back + Vector3.right;
			rot = transform.rotation * LeftTopCorner;
			mybody.velocity = new Vector3(rot.x*Speed,mybody.velocity.y,rot.z * Speed);
			mybody.velocity = mybody.velocity;
		}
		if (Input.GetKey(MoveDown) && !Input.GetKey (MoveRight) && Input.GetKey(MoveLeft)) {
			mybody.velocity = new Vector3(mybody.velocity.x,mybody.velocity.y,0);
			Vector3 LeftTopCorner = Vector3.back + Vector3.left;
			rot = transform.rotation * LeftTopCorner;
			mybody.velocity = new Vector3(rot.x*Speed,mybody.velocity.y,rot.z * Speed);
			mybody.velocity = mybody.velocity;
		}
//		Curve
//		Jump
		if (Input.GetKeyDown (KeyCode.Space)){
			mybody.velocity += new Vector3(0,JumpPower,0);

		}
	}
	public void IDIOTAnimation(){
		if(!ScaledArm){
		if (RightArm.transform.localScale.z < SizeOfArm){
		RightArm.transform.localScale += new Vector3 (0,0,SizeSpeedingArm * Time.deltaTime);
		}
		if (RightArm.transform.localScale.z >= SizeOfArm){
				RightArm.transform.localScale = new Vector3 (RightArm.transform.localScale.x,RightArm.transform.localScale.y,SizeOfArm);
			ScaledArm = true;
				TurnedOnScalingOfTheArm = false;
				ArmCollider.gameObject.GetComponent<BoxCollider>().enabled = true;
			}
		}
		if(ScaledArm){
			if (RightArm.transform.localScale.z >= 1){
				RightArm.transform.localScale -= new Vector3 (0,0,SizeSpeedingArm * Time.deltaTime);
			}
			if (RightArm.transform.localScale.z < 1){
				RightArm.transform.localScale = new Vector3 (RightArm.transform.localScale.x,RightArm.transform.localScale.y,1);
				ScaledArm = false;
				TurnedOnScalingOfTheArm = false;
				ArmCollider.gameObject.GetComponent<BoxCollider>().enabled = false;
			}
		}
	}

}

If you need additional information, just tell me

A couple questions:

  • Is there a particular reason the arms need to be children of the camera?
  • Do you have any OnCollisionEnter or OnTriggerEnter functions that are registering a collision with the arm collider?

Areleli Games