Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: DB23089 on April 21, 2021, 07:12:09 AM

Title: Moving towards in screen coordinates
Post by: DB23089 on April 21, 2021, 07:12:09 AM
Hello to everyone,
I am working on missile lock system. Want i want to do is when raycasting detects object that UI element (image of lock system) move to 3d object and stays until rocket detroy object even if object is moving. I want to do that in 2d coordinates that image is always visible to camera and does not go in depth in forward axis. I have screen coordinates of both objects just dont know how to translate image over time. So far i try tween actions,Vector2 move towards and nothing works as expected. Any hints if I am missing something obvius?
Title: Re: Moving towards in screen coordinates
Post by: djaydino on April 21, 2021, 11:20:31 AM
Hi.
if its ui (canvas)
You probably want to use 'Get Position' (3d object) 'Word to Screen Point' and 'Rect Transform Set Local Position'
Title: Re: Moving towards in screen coordinates
Post by: DB23089 on April 21, 2021, 03:37:37 PM
Thank you,i managed that part but i want that when target is recognized this image in Canvas comes slowly from corner towards the target. What action should i use with this obtained previous screen coordinates? I try so far Vector2 Move towards,translate position,tween position and Move Towards. Nothing works as expected.
Title: Re: Moving towards in screen coordinates
Post by: djaydino on April 22, 2021, 07:27:03 AM
Hi.
Maybe 'Tween UI Position' can help there :)