# Unity script error (620759)

**URL:** https://discussions.unity.com/t/unity-script-error-620759/620759
**Category:** Scripting
**Tags:** Scripting
**Created:** [March 17, 2016, 10:09pm UTC](https://discussions.unity.com/t/unity-script-error-620759/620759 "2016-03-17T22:09:49Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![halojman](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/halojman/32/455667_2.png) [@halojman](https://discussions.unity.com/u/halojman)
#### Post date: [March 17, 2016, 10:09pm UTC](https://discussions.unity.com/t/unity-script-error-620759/620759/1 "2016-03-17T22:09:49Z")

</div>

I’m currently working on a project, But I’ve ran into an error. I have no clue how to fix it, these are my errors:

**Assets/Standard Assets/CrossPlatformInput/Scripts/AxisTouchButton.cs(3,19): error CS0234: The type or namespace name `EventSystems' does not exist in the namespace `UnityEngine’. Are you missing an assembly reference?**  
**Assets/Standard Assets/CrossPlatformInput/Scripts/AxisTouchButton.cs(7,55): error CS0246: The type or namespace name `IPointerDownHandler' could not be found. Are you missing a using directive or an assembly reference?** **Assets/Standard Assets/CrossPlatformInput/Scripts/AxisTouchButton.cs(7,76): error CS0246: The type or namespace name `IPointerUpHandler’ could not be found. Are you missing a using directive or an assembly reference?**  
**Assets/Standard Assets/CrossPlatformInput/Scripts/Joystick.cs(3,19): error CS0234: The type or namespace name `EventSystems' does not exist in the namespace `UnityEngine’. Are you missing an assembly reference?**

**Assets/Standard Assets/CrossPlatformInput/Scripts/Joystick.cs(7,48): error CS0246: The type or namespace name `IPointerDownHandler’ could not be found. Are you missing a using directive or an assembly reference?**

**Assets/Standard Assets/CrossPlatformInput/Scripts/Joystick.cs(7,69): error CS0246: The type or namespace name `IPointerUpHandler’ could not be found. Are you missing a using directive or an assembly reference?**

**ssets/Standard Assets/CrossPlatformInput/Scripts/Joystick.cs(7,88): error CS0246: The type or namespace name `IDragHandler' could not be found. Are you missing a using directive or an assembly reference?** **Assets/Standard Assets/CrossPlatformInput/Scripts/TouchPad.cs(3,19): error CS0234: The type or namespace name `EventSystems’ does not exist in the namespace `UnityEngine'. Are you missing an assembly reference?** **Assets/Standard Assets/CrossPlatformInput/Scripts/TouchPad.cs(4,19): error CS0234: The type or namespace name `UI’ does not exist in the namespace `UnityEngine'. Are you missing an assembly reference?** **Assets/Standard Assets/CrossPlatformInput/Scripts/TouchPad.cs(9,48): error CS0246: The type or namespace name `IPointerDownHandler’ could not be found. Are you missing a using directive or an assembly reference?**

**Assets/Standard Assets/CrossPlatformInput/Scripts/TouchPad.cs(9,69): error CS0246: The type or namespace name `IPointerUpHandler’ could not be found. Are you missing a using directive or an assembly reference?**

**Assets/Standard Assets/Utility/EventSystemChecker.cs(4,19): error CS0234: The type or namespace name `EventSystems' does not exist in the namespace `UnityEngine’. Are you missing an assembly reference?**  
**Assets/Standard Assets/Utility/FPSCounter.cs(3,19): error CS0234: The type or namespace name `UI' does not exist in the namespace `UnityEngine’. Are you missing an assembly reference?**

My Script is:

```csharp
using System;
using UnityEngine;
using UnityEngine.EventSystems;

namespace UnityStandardAssets.CrossPlatformInput
{
    public class AxisTouchButton : MonoBehaviour, IPointerDownHandler, IPointerUpHandler
    {
        // designed to work in a pair with another axis touch button
        // (typically with one having -1 and one having 1 axisValues)
        public string axisName = "Horizontal"; // The name of the axis
        public float axisValue = 1; // The axis that the value has
        public float responseSpeed = 3; // The speed at which the axis touch button responds
        public float returnToCentreSpeed = 3; // The speed at which the button will return to its centre

        AxisTouchButton m_PairedWith; // Which button this one is paired with
        CrossPlatformInputManager.VirtualAxis m_Axis; // A reference to the virtual axis as it is in the cross platform input

        void OnEnable()
        {
            if (!CrossPlatformInputManager.AxisExists(axisName))
            {
                // if the axis doesnt exist create a new one in cross platform input
                m_Axis = new CrossPlatformInputManager.VirtualAxis(axisName);
                CrossPlatformInputManager.RegisterVirtualAxis(m_Axis);
            }
            else
            {
                m_Axis = CrossPlatformInputManager.VirtualAxisReference(axisName);
            }
            FindPairedButton();
        }

        void FindPairedButton()
        {
            // find the other button witch which this button should be paired
            // (it should have the same axisName)
            var otherAxisButtons = FindObjectsOfType(typeof(AxisTouchButton)) as AxisTouchButton[];

            if (otherAxisButtons != null)
            {
                for (int i = 0; i < otherAxisButtons.Length; i++)
                {
                    if (otherAxisButtons[i].axisName == axisName && otherAxisButtons[i] != this)
                    {
                        m_PairedWith = otherAxisButtons[i];
                    }
                }
            }
        }

        void OnDisable()
        {
            // The object is disabled so remove it from the cross platform input system
            m_Axis.Remove();
        }

        public void OnPointerDown(PointerEventDat data)
        {
            if (m_PairedWith == null)
            {
                FindPairedButton();
            }
            // update the axis and record that the button has been pressed this frame
            m_Axis.Update(Mathf.MoveTowards(m_Axis.GetValue, axisValue, responseSpeed * Time.deltaTime));
        }

        public void OnPointerUp(PointerEventData data)
        {
            m_Axis.Update(Mathf.MoveTowards(m_Axis.GetValue, 0, responseSpeed * Time.deltaTime));
        }
    }
}

```

Can someone help me fix the errors, and explain what they are?

---

<div class="post-metadata">

### Author: ![alexzzzz](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/alexzzzz/32/333491_2.png) [@alexzzzz](https://discussions.unity.com/u/alexzzzz)
#### Post date: [March 17, 2016, 10:53pm UTC](https://discussions.unity.com/t/unity-script-error-620759/620759/2 "2016-03-17T22:53:21Z")

</div>

I would guess that your project doesn’t reference UnityEngine.UI.dll.

---

<div class="post-metadata">

### Author: ![Kiwasi](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/kiwasi/32/351502_2.png) [@Kiwasi](https://discussions.unity.com/u/Kiwasi)
#### Post date: [March 18, 2016, 2:42am UTC](https://discussions.unity.com/t/unity-script-error-620759/620759/3 "2016-03-18T02:42:49Z")

</div>

> [@alexzzzz](#):
>
> I would guess that your project doesn’t reference UnityEngine.UI.dll.

This. What version of Unity are you using?

---

<div class="post-metadata">

### Author: ![Abhiroop-Tandon](https://avatars.discourse-cdn.com/v4/letter/a/a8b319/32.png) [@Abhiroop-Tandon](https://discussions.unity.com/u/Abhiroop-Tandon)
#### Post date: [September 20, 2016, 11:26pm UTC](https://discussions.unity.com/t/unity-script-error-620759/620759/4 "2016-09-20T23:26:06Z")

</div>

I am having the same issue and i am using Unity5.4.1  
how did you fix it ??

---

<div class="post-metadata">

### Author: ![Vedrit](https://avatars.discourse-cdn.com/v4/letter/v/9fc29f/32.png) [@Vedrit](https://discussions.unity.com/u/Vedrit)
#### Post date: [September 20, 2016, 11:52pm UTC](https://discussions.unity.com/t/unity-script-error-620759/620759/5 "2016-09-20T23:52:24Z")

</div>

Include  
`using UnityEngine.UI;` in your script, if I understand correctly

---

<div class="post-metadata">

### Author: ![Abhiroop-Tandon](https://avatars.discourse-cdn.com/v4/letter/a/a8b319/32.png) [@Abhiroop-Tandon](https://discussions.unity.com/u/Abhiroop-Tandon)
#### Post date: [September 21, 2016, 11:28am UTC](https://discussions.unity.com/t/unity-script-error-620759/620759/6 "2016-09-21T11:28:08Z")

</div>

> [@Vedrit](#):
>
> Include  
> `using UnityEngine.UI;` in your script, if I understand correctly

Closing unity and opening it again fixed for me hahaha. Thanks for the reply though, i’ll try it next time i get them. It was only coming when i was building the project
