Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

'Input' is an ambiguous reference between 'UnityEngine.Input' and 'UnityEngine.Windows.Input' error

Hi everyone i just update the VS and i have this error.(‘Input’ is an ambiguous reference between ‘UnityEngine.Input’ and ‘UnityEngine.Windows.Input’)
The code I got error:
float moveHorizontal = Input.GetAxis("Horizontal");
float moveVertical = Input.GetAxis("Vertical");
Thank you for your helps.

(I tried change code to UnityEngine.Input but i dont want to)

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

The error most probably appears because you have the following two lines at the top of your file:

using UnityEngine;
using UnityEngine.Windows;

The problem lies in the fact that both these namespaces contain a definition for Input.

As you apparently want to use UnityEngine.Input, you can do one of the following:

1) Remove the line using UnityEngine.Windows; (but this might induce another problem if you are using things defined in this namespace)

2) Add the line using Input=UnityEngine.Input; (so there is no ambiguity as to which one you want)

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading