Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Cannot implicitly convert type `UnityEngine.Vector2' to `bool'

Discussion in 'Immediate Mode GUI (IMGUI)' started by Xazerek, May 31, 2015.

  1. Xazerek

    Xazerek

    Joined:
    Nov 3, 2014
    Posts:
    134
    Hi! I have an error:
    Code (csharp):
    1. Assets/_Survive/Scripts/Game/Mainmenu.cs(284,33): error CS0029: Cannot implicitly convert type `UnityEngine.Vector2' to `bool'
    284 lane is the first lane in this script
    Code (csharp):
    1. if (GUI.Button (new Rect (Screen.width / 2 - 221, Screen.height / 2 + 0 + (-100 * delta), 140, 140), MenuIcons[11])) { //+
    2.                 if(scale = new Vector2(1.25F, 0.25F))
    3.                 {
    4.                 //do nothing
    5.                 }
    6.                 else
    7.                 {
    8.                 scale += new Vector2(0.25F, 0.25F);
    9.                 }
    10.             }
     
  2. rakkarage

    rakkarage

    Joined:
    Feb 3, 2014
    Posts:
    683
    == is compare = is assign
     
    Xazerek likes this.
  3. Xazerek

    Xazerek

    Joined:
    Nov 3, 2014
    Posts:
    134
    @rakkarage
    Thanks! I didnt understand at first. :)
     
    Last edited: Jun 1, 2015
  4. manlaikin1994

    manlaikin1994

    Joined:
    May 15, 2015
    Posts:
    179
    lol accurate english, i love it