Announcement

Collapse
No announcement yet.

Selection of only one interactable item at time

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Selection of only one interactable item at time

    Hi everyone!
    I am asking if anyone knows how to handle this situation in blueprints.
    I have a scene with 4 items (that are child blueprints class and that are clickable (after selecting it changes a material to fresnel with sine, so it is "shining") Selection/deselection works fine but i want only one of them to be selected at the time,
    so after selecting one of them and trying to select other, the first one would deselect and second one would be selected.

    I thought i came up with solution when I created an Array that stores all the Actors of class, but now i dont know how to select actor from this array that has bool "AllowSelection(true)"
    (If this is the approach i should take)

    If you have any ideas and methods or tips, I would be greatful for your help!,
    Thank you!
    Last edited by DominikL.; 10-17-2020, 05:23 PM.

    #2
    Originally posted by KowalskiCZK View Post
    Hi everyone!
    I am asking if anyone knows how to handle this situation in blueprints.
    I have a scene with 4 items (that are child blueprints class and that are clickable (after selecting it changes a material to fresnel with sine, so it is "shining") Selection/deselection works fine but i want only one of them to be selected at the time,
    so after selecting one of them and trying to select other, the first one would deselect and second one would be selected.

    I thought i came up with solution when I created an Array that stores all the Actors of class, but now i dont know how to select actor from this array that has bool "AllowSelection(true)"
    (If this is the approach i should take)

    If you have any ideas and methods or tips, I would be greatful for your help!,
    Thank you!
    Hi man
    long story short , you just need a variable,.. and you can use the same you use for reference
    Your click select the actor and save the reference in a variable, just use the same variable for all the selection and only 1 will be stored.
    When you want deselect you can set the varaible "to nothing" here a screen
    Click image for larger version

Name:	SelectJustOne.jpg
Views:	10
Size:	176.0 KB
ID:	1823275

    Comment


      #3
      i figured out some work-around i am not quite sure if it can work like this tho..

      Boolean "Selection is same" = This is just a check if Selected actor is the same as Actor underneath the cursor (hover over)

      Now i have a problem that it is not correctly casting the variable "Is Selected" to my effector (Name of parent class of interactable items)

      Click image for larger version

Name:	SnippingImageBlueprint.PNG
Views:	10
Size:	312.3 KB
ID:	1823281

      Comment


        #4
        edit - i deleted the boolean casting in the end, since it wasnt working out for me...this is how it looked with them
        Attached Files
        Last edited by DominikL.; 10-18-2020, 07:48 AM.

        Comment

        Working...
        X