Can't Access Componenet of Third Person Controller

I am using the standard Asset Third person controller provided by Unity and I need to access it’s User control script so I can disable it when i don’t need the player to move. However It seems like I cannot access either of the default script componenets that comes with the controller. This controller didn’t have a character motor or any thing like that. Just came with Third Person Character and Third Person User Control Script.

Here is the code of the script I am trying to access:

using System;
using UnityEngine;
using System.Collections;

using UnityStandardAssets.CrossPlatformInput;

namespace UnityStandardAssets.Characters.ThirdPerson
{
	[RequireComponent(typeof(ThirdPersonCharacter))]

	public class ThirdPersonUserControl : MonoBehaviour
	{
		private ThirdPersonCharacter m_Character; // A reference to the ThirdPersonCharacter on the object
		private Transform m_Cam;                  // A reference to the main camera in the scenes transform
		private Vector3 m_CamForward;             // The current forward direction of the camera
		private Vector3 m_Move;
		private bool m_Jump;                      // the world-relative desired move direction, calculated from the camForward and user input.

		public bool notMove = false;
		private Vector3 moveDirection;
		private float maxDashTime = 10f;
		private float dashSpeed = 6f;
		private float dashStoppingSpeed = 1f;
		private float currentDashTime;
		private float timeRemaining = 0f;
		private bool canDash = true;
		private bool isShaking ;
		private float timeLeft = 3f;
		private float currentTime = 0f;
		private bool shakeAllow = true;
		float v ;
		float h;
        
		public void Start ()
		{
			// get the transform of the main camera
			if (Camera.main != null) {
				m_Cam = Camera.main.transform;
			} else {
				Debug.LogWarning (
                    "Warning: no main camera found. Third person character needs a Camera tagged \"MainCamera\", for camera-relative controls.");
				// we use self-relative controls in this case, which probably isn't what the user wants, but hey, we warned them!
			}

			// get the third person character ( this should never be null due to require component )
			m_Character = GetComponent<ThirdPersonCharacter> ();



		}

		public void Update ()
		{


			if (!m_Jump) {
				m_Jump = CrossPlatformInputManager.GetButtonDown ("Jump");
			}


			if (Input.GetKey (KeyCode.Z) && canDash) {
				currentDashTime = 0.0f;
				Dash ();

			}


			if (Input.GetKey (KeyCode.C) && shakeAllow) {
				
				timeLeft -= Time.deltaTime;
				
				if (timeLeft == 0) {
					shakeAllow = false;
					StartCoroutine (shakeCoolDown ());
					timeLeft = 3f;
				}
				
			} else {
				
				timeLeft = 3f;
			}


			if (Input.GetKey (KeyCode.Z) && canDash || Input.GetKey (KeyCode.C) && shakeAllow) {
				notMove = true;
			} else {
				notMove = false;
			}
			



		}

		IEnumerator shakeCoolDown ()
		{
			
			yield return new WaitForSeconds (2f);
			shakeAllow = true;
			
		}

		// Fixed update is called in sync with physics
		private void FixedUpdate ()
		{
			if (!notMove) {
				// read inputs
				h = CrossPlatformInputManager.GetAxis ("Horizontal");

//			Debug.Log(h);
				v = CrossPlatformInputManager.GetAxis ("Vertical");
				bool crouch = Input.GetKey (KeyCode.C);

				// calculate move direction to pass to character
				if (m_Cam != null) {
					// calculate camera relative direction to move:
					m_CamForward = Vector3.Scale (m_Cam.forward, new Vector3 (1, 0, 1)).normalized;
					m_Move = v * m_CamForward + h * m_Cam.right;
				} else {
					// we use world-relative directions in the case of no main camera
					m_Move = v * Vector3.forward + h * Vector3.right;
				}
#if !MOBILE_INPUT
				// walk speed multiplier
				if (Input.GetKey (KeyCode.LeftShift))
					m_Move *= 0.5f;
#endif

				// pass all parameters to the character control script
				m_Character.Move (m_Move, crouch, m_Jump);
				m_Jump = false;
        
		
		
			} else {
				h = CrossPlatformInputManager.GetAxis ("Horizontal");
				h *= 0.5f; //Reduce speed while charging
				v = CrossPlatformInputManager.GetAxis ("Vertical");
				v *= 0.5f; // reduce speed while charging

				Debug.Log (h + " " + v);



				m_CamForward = Vector3.Scale (m_Cam.forward, new Vector3 (1, 0, 1)).normalized;



				m_Move = v * Vector3.forward + h * Vector3.right;

				m_Character.Move (m_Move, false, m_Jump);

			}

		}

		void Dash ()
		{


			timeRemaining += Time.deltaTime;

			if (currentDashTime < maxDashTime) {
				moveDirection = new Vector3 (0, 0, dashSpeed);
//				moveDirection = transform.forward;

				currentDashTime += dashStoppingSpeed + timeRemaining;
			} else {
				moveDirection = Vector3.zero;
			}

			if (timeRemaining >= 1 || Input.GetKeyUp (KeyCode.Z)) {


				transform.Translate (moveDirection * Time.deltaTime / 2);
//				canDash = false;
				StartCoroutine (resetCanDash ());
			}

		}

		IEnumerator resetCanDash ()
		{

			yield return new WaitForSeconds (0.5f);
			canDash = false;
			timeRemaining = 0;

			yield return new WaitForSeconds (2f);
			canDash = true;
			timeRemaining = 0;
		}

	}
}

Here is how I am accessing it. I’ve already double checked the tag and things are correct.:

	public GameObject player;

	// Use this for initialization
	void Start () {
		player = GameObject.FindGameObjectWithTag("Player1");
		player.GetComponent<ThirdPersonUserControl>().enabled = false;

	}

Hi! so I’ve figured out the solution for this. This may help some one in future. Since this asset was defined under a different namespace, I need to call that first before accessing it. So the code would look something like this :

player.gameObject.GetComponent<UnityStandardAssets.Characters.ThirdPerson.ThirdPersonUserControl>().enabled = false;

put

using StarterAssets; at the top of script

then it will work

Player.GetComponent().enabled = true;