Raycasting Door Animator

Hey guys just a little stuck with animator. I have this raycasting script to open doors on a mouse click with animations through animator(if that makes sense). I have made four animation with four transitions inside the animator so it goes Door Closed > Door Opening > Door Open > Door Closing. So it all connects together. I’ve tried playing with the parameters but nothing is working and I have named the parameter the same as in the script. What kind of parameter do I choose and do I have to change anything around. I have tried bool, into and float and I’ve tried playing around with the greater and lower part but just can’t get it working?

Here’s the script below:

using UnityEngine;
using System.Collections;

public class DoorRaycast : MonoBehaviour 
{

	public Animator anim;

	void Update()
	{
		RaycastHit hit;
		Vector3 fwd = transform.TransformDirection (Vector3.forward);
		if (Physics.Raycast(transform.position, fwd, out hit, 10))

		{
			if (Input.GetMouseButtonDown(0)&& hit.collider.tag=="DOOR")
			{
				anim.SetTrigger("DoorOPEN");
				audio.Play();
			}
		}
		/*{
			anim.SetTrigger("DoorCLOSE");
			audio.Play();
		}*/

		Debug.DrawRay (transform.position,fwd,Color.green);
	
	}
}

I’d start with the good ol’ dummy check (i.e. is it plugged in?)

Select the AnimatorController, goto the Animator window and double check that you have added a DoorOPEN parameter.

Next, click the transition (the arrow on the graph layout pointing from DoorCLOSE) and make sure you added a condition DoorOPEN.

Note that you can right-click one of the states, like DoorCLOSE and set it as the default state.