Author Topic: Where's ScreenToWorldPoint() ?  (Read 4716 times)

huminaboz

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1
    • View Profile
Where's ScreenToWorldPoint() ?
« on: April 23, 2017, 05:00:15 PM »
Okay am I going crazy, or does UICamera.ScreenToWorldPoint() not exist anymore?

  1. public UICamera uiCam; //assigned in editor
  2. Vector2 screenPos = (Vector2) Camera.main.WorldToScreenPoint(position);
  3. transform.position =  uiCam.ScreenToWorldPoint(screenPos);

error CS1061: Type `UICamera' does not contain a definition for `ScreenToWorldPoint' and no extension method `ScreenToWorldPoint' of type `UICamera' could be found. Are you missing an assembly reference?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Where's ScreenToWorldPoint() ?
« Reply #1 on: April 26, 2017, 07:12:13 AM »
UICamera never had it. Camera did -- it's a Unity class.