playMaker

Author Topic: World to Screen Space help  (Read 5386 times)

BenWesorick

  • Playmaker Newbie
  • *
  • Posts: 13
World to Screen Space help
« on: November 29, 2023, 03:59:38 PM »
I want to map the screen point of a UI icon on an overlay canvas to the world position of a door in my game. I'm currently getting the World Position of the door location > converting the location with World To Screen Point > and then setting the local position of the UI Image to the stored X and Y position of the converted screen point.


Is anyone able to tell me what I'm doing wrong here?

Thanks!

« Last Edit: November 29, 2023, 04:03:32 PM by BenWesorick »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7618
    • jinxtergames
Re: World to Screen Space help
« Reply #1 on: November 29, 2023, 04:26:19 PM »
Hi.
Maybe Set Position, space should be "World"

BenWesorick

  • Playmaker Newbie
  • *
  • Posts: 13
Re: World to Screen Space help
« Reply #2 on: November 29, 2023, 04:40:51 PM »
That didn't work. Thanks though! Does my current setup look like it should work in theory? If so, maybe something else is throwing it off.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7618
    • jinxtergames
Re: World to Screen Space help
« Reply #3 on: November 29, 2023, 04:55:05 PM »
Hi.
Maybe you should use Rect transform actions to position UI

BenWesorick

  • Playmaker Newbie
  • *
  • Posts: 13
Re: World to Screen Space help
« Reply #4 on: November 29, 2023, 05:49:05 PM »
No luck :(

Maxi

  • Playmaker Newbie
  • *
  • Posts: 41
Re: World to Screen Space help
« Reply #5 on: December 18, 2023, 06:26:39 AM »
Hi, are you still struggling with this?
I was wondering what you actually want the outcome to be?
Do you want the door icon to always be visible on the screen even when you are not looking at it- which I am not sure why you would want that or how?
Or do you want the icon to be visible on the door when having the door in frame - in which case I would use a World Space Canvas linked to the door object and put the icon on that (any maybe change its scale in regards to how close the player is).