We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.

Object selection/deselection

Home Forums Puzzles Object selection/deselection

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #65299
    kitt
    Customer

    Heya,

    (Sorry if this is a repost, I can’t tell cos I can’t find my first topic anywhere)

    I’m having some trouble with selecting/deselecting 3D objects. I have a grid of planes set up in the 3D space, and various objects. When the user clicks on an object and then a grid square, I want the object to move to the x and y coordinates of that grid square. I have the planes in a ‘group’ in blender, and I am using the ‘picked object’ puzzle to determine which grid square the object moves to. So far so good.

    What I have trouble with is deselecting the object. For some reason, when I select a second object and another grid square, both that and the first object move. No matter how many object I select, they all move. How can I get it so that it deselects the first object so only one moves at any time?

    Things I have tried so far, to no avail:
    Selecting a HTML icon instead of a 3D object.
    Making a list of 3D objects to move and choosing the object at a number in the list.
    Making an empty list and adding 3D objects at first/last and then moving only first/last.

    Attached a few example screenshots of different puzzle setups. Any and all help you can offer would be amazing! :heart:

    Attachments:
    You must be logged in to view attached files.
    #65303
    kdv
    Participant

    Nothing else.

    Puzzles and JS. Fast and expensive.

    If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of meaning at all.

    #65305
    kitt
    Customer

    Nothing else.

    But I need the user to select one of many items first before selecting a grid square. And the way I’ve set the puzzle up works, but it moves all selected objects, rather than the most recently selected objects, and that’s the issue I’m trying to solve.

    #65306
    kdv
    Participant

    Ok. Easy.

    You should understand that the when clicked puzzle is not an action function, it’s an event listener. It registers actions for chosen objects.

    Puzzles and JS. Fast and expensive.

    If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of meaning at all.

    #65308
    kitt
    Customer

    Thank you so much! That solved it.

    I had an inkling that the selected object would need to be saved as something (be it variable or list or something else). Clearly I was going down the wrong rabbit hole with the lists.

    Cheers again :good:

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.