Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: Vâel on October 16, 2017, 06:13:45 AM

Title: I can't store UI elements with mouse pick..
Post by: Vâel on October 16, 2017, 06:13:45 AM
Hey everyone,

I am trying to store UI element with "Mouse pick" action but it always stores other objects like plane, cubes..

Any suggestion or solution to fix that?

Regards

Vael

Title: Re: I can't store UI elements with mouse pick..
Post by: omgitstri on October 16, 2017, 12:10:33 PM
Hello Vael,

You could try to use the LayerMask option in the MousePick action. Set it to 1 then  Choose UI for the Element 0, that should only allow your mouse pick to affect any gameobject with the UI layer applied.

Tri Nguyen
Title: Re: I can't store UI elements with mouse pick..
Post by: jeanfabre on October 17, 2017, 02:33:24 AM
Hi,

Did you manage to make this work?

 bye,

 Jean
Title: Re: I can't store UI elements with mouse pick..
Post by: Vâel on October 17, 2017, 05:11:27 AM
Hey omgitstri and jeanfabre,

I tried it, but it didn't work. When I use layer mask for UI, it doesn't store any object not planes, cubes but also not any UI elements. I set all Canvas and it's all children to UI layer.

I can only store 2d sprites(I add 2d collider component) as game object but it does not work with Screen Space-Overlay and does not show up in scene if I use any Background for canvas.

I am trying few methods, I hope I can handle it...

I can try second camera with Screen Space-Camera for UI but background problem will occur again..

Best Regards,

Vael
Title: Re: I can't store UI elements with mouse pick..
Post by: omgitstri on October 18, 2017, 10:31:52 AM
Hello Vael,

Maybe you can try this action "Get Last Pointer Data Info"? I used it for an inventory system to drag items from one slot to another and it works quite well. I have my FSM set up so that when I click on the UI, I save the gameobject in the 'Pointer Enter' of the action.

Tri Nguyen