Forum begins after the advertisement:


[Part 10] “Ambiguous reference” compilation error in a code section

Home Forums Video Game Tutorial Series Creating a Rogue-like Shoot-em Up in Unity [Part 10] “Ambiguous reference” compilation error in a code section

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #15642
    Zenn_Glitchh
    Level 1
    Participant
    Helpful?
    Up
    0
    ::

    I ran into a problem while doing the video Part 10: Game Manager and UI2 from 15:42 minute onwards

    View post on imgur.com

    #15643
    Terence
    Level 30
    Keymaster
    Helpful?
    Up
    0
    ::

    Skirk,

    Remove this line and it should work:

    using UnityEngine.UIElements;

    The reason is because the Image component can be referring either to UnityEngine.UIElements.Image or UnityEngine.UI.Image. When you only include one of them, then there is no question what Image refers to; but C# gets confused when you import both because it doesn’t know which one you want to use.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.

Go to Login Page →


Advertisement below: