Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: a0nasser on January 06, 2019, 05:43:56 AM

Title: UI trigger Collide
Post by: a0nasser on January 06, 2019, 05:43:56 AM
Hi all
I hope everyone happy at this new year

So I'm making this new game, and it all about UI's.

And i want to drag a buttons into images that look like a box, then i will trigger an event.

To be more clear, There are button tasks and the player can drag these task to any of the boxes on the canvas.

The question is : How to trigger an event when the button been dragged into one of the boxes, Is there a collide system for the UI objects Or is there another way to do it?


Thanks guys for any help and have a nice day
Title: Re: UI trigger Collide
Post by: djaydino on January 06, 2019, 09:45:19 AM
Hi.

Maybe this video can get you in the right direction :

Title: Re: UI trigger Collide
Post by: a0nasser on January 16, 2019, 11:17:43 AM
Thanks very much djaydino
It is a long video but with lot of great information.

I have found easy way to do it, but not sure if it correct.
Just added 3D box collider and 3D riggedbody to the UI elements and used the Trigger actions with tags and every thing worked fine.

Its working great right now, but i'm sure there must be a better way to do it.

Thanks again and have a nice day
Title: Re: UI trigger Collide
Post by: djaydino on January 16, 2019, 10:51:48 PM
Hi.
I did a little googling, and so far i think its ok to use the box colliders.
Title: Re: UI trigger Collide
Post by: jeanfabre on January 17, 2019, 12:56:53 AM
Hi,

 check out the sample on the Ecosystm about drag and drop, it does just that.

it's using the uGui system from the ecosystem, but you can do the same with the built in UI support from PlayMaker.

(https://i.imgur.com/JtpZyxg.png)

 Bye,

 Jean