playMaker

Author Topic: How to add a "selection indicator" to an object [SOLVED]  (Read 568 times)

lmon92

  • Playmaker Newbie
  • *
  • Posts: 15
How to add a "selection indicator" to an object [SOLVED]
« on: November 07, 2023, 10:43:42 AM »
Hi,
let's say that I have several game objects which are pictures. I want to add a circle or equivalent to the picture to indicate that I have selected it. I assume this can be done with layers no ? can not find any tutorial or documentation on this, so I guess my search keywords are not the right ones... It's 100% sure that this was already raised by someone
Thanks for pointing me to the right documentation , tuto or video
thanks !
« Last Edit: November 16, 2023, 04:28:41 AM by lmon92 »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7619
    • jinxtergames
Re: How to add a "selection indicator" to an object
« Reply #1 on: November 10, 2023, 04:12:01 PM »
Hi.
Can you give more info?

are your object UI object 2d object 3d objects?

if for example UI buttons you can use the button component directly.

lmon92

  • Playmaker Newbie
  • *
  • Posts: 15
Re: How to add a "selection indicator" to an object
« Reply #2 on: November 11, 2023, 12:44:59 PM »
Hi djaydino, thanks for your reply.
I have an rawimage object, in 2D that I want to make appear as selected / not Selected.
I was thinking to use the component 'outline' at first but I can not configure its settings .
( I add component outline to my object but I can not choose the "effect color' of the outline , as by default it's white).
so I guess someone else has for sure the same request , and find how this was solved.
The trick you proposed with button is working from a functional point of view, it answer to the need.
But how can I get the button which is selected then ?
Thanks !
« Last Edit: November 11, 2023, 12:49:26 PM by lmon92 »

lmon92

  • Playmaker Newbie
  • *
  • Posts: 15
Re: How to add a "selection indicator" to an object
« Reply #3 on: November 12, 2023, 10:13:47 AM »
Hi
To go further, this is what I defined so far to get the reference of the object selected. I feel it very "heavy" , so hence my wonder if there is not something nicer and smoother already existing ?
The config :
https://i.ibb.co/gjyKR0x/selected.png
thanks !

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7619
    • jinxtergames
Re: How to add a "selection indicator" to an object
« Reply #4 on: November 12, 2023, 11:28:02 AM »
you could just compare the game object itself

lmon92

  • Playmaker Newbie
  • *
  • Posts: 15
Re: How to add a "selection indicator" to an object
« Reply #5 on: November 12, 2023, 01:41:05 PM »
In fact, I don't think so.
I have many object created on the fly.
After setting a "selection indicator" on one , I will to "edit" it.
I set the broadcasted event on the object and set a global var to store it.
Is there an action which "collect from X the one selected " the selected object ? ( ( concrete example : select the selected child from cnavas acme )
Thanks
« Last Edit: November 12, 2023, 01:49:25 PM by lmon92 »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7619
    • jinxtergames
Re: How to add a "selection indicator" to an object
« Reply #6 on: November 12, 2023, 06:17:21 PM »
Hi.
Even when created at runtime you should still be able to compare as game object.
as each object is unique, even if you make 10 clones of the same object, they will still be different objects (with their own GUID)

lmon92

  • Playmaker Newbie
  • *
  • Posts: 15
Re: How to add a "selection indicator" to an object
« Reply #7 on: November 13, 2023, 07:19:45 AM »
sorry for my bad english, I think I'm not clear on my explanations.
put aside all my previous explanations :  let's say that I have 3 buttons on a canvas .
which action should I use to  get the gameobject reference and make some "edits" on it ( like scale, rotation ..etc.)
Thanks and sorry again

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7619
    • jinxtergames
Re: How to add a "selection indicator" to an object
« Reply #8 on: November 15, 2023, 07:29:37 AM »
Ui Selected action can get the selected object.

To manipulate the scale/etc. use Rect Transform actions (for ui objects inside canvas)

lmon92

  • Playmaker Newbie
  • *
  • Posts: 15
Re: How to add a "selection indicator" to an object [SOLVED]
« Reply #9 on: November 16, 2023, 04:27:55 AM »
understood ! I did some tests, all set ! Thanks a lot !