playMaker

Author Topic: itweening sprite to uGui image  (Read 1985 times)

bcmorris

  • Playmaker Newbie
  • *
  • Posts: 9
itweening sprite to uGui image
« on: February 09, 2016, 07:27:49 AM »
Hello,

I did search for this but either it's not a topic or I don't understand the replies so sorry if I missed this, but here is my problem.

In my simple 2d game I have a 2d sprite that needs to move to the position of a UI-Image during runtime (so the position of the UI-image in relation to my Main camera during gameplay), but what ever actions I use either the sprite moves to the position of the UI-image in the Scene view, the lower left corner of the canvas, or a random position.
The UI-Image is parented to a Panel, which is parented to a Canvas (set to screen space) so a basic setup with the Panel and Ui-Image in the upper left corner.

I tried the "ScreenToWorldPoint", "WorldToScreen" actions as well as the "Rect Transform Screen Point to World Point", and "Rect Transform World to Screen Point" and at this point I'm pretty confused with all the World, Screen, Local, Camera space options, but I'm pretty sure I need to store the UI-Image's position as a vector3 or vector2 variable and then tween my sprite to it. Any help would be welcome.

Brian

bcmorris

  • Playmaker Newbie
  • *
  • Posts: 9
Re: itweening sprite to uGui image
« Reply #1 on: February 11, 2016, 08:07:01 AM »
giving this a bump...anyone have any ideas? :-\

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: itweening sprite to uGui image
« Reply #2 on: February 11, 2016, 01:10:27 PM »
Hi,

 that's tricky indeed. Can you bump me next week, I hope to have more time, I'll do a sample.

Bye,

 Jean

bcmorris

  • Playmaker Newbie
  • *
  • Posts: 9
Re: itweening sprite to uGui image
« Reply #3 on: February 11, 2016, 02:08:29 PM »
Thanks for the reply...Okay I will bump you in a week. I'm a bit relieved to here it is indeed tricky, thought I was losing my touch  ;D