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.

Mobile Object Selection

Home Forums Puzzles Mobile Object Selection

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #55214
    Aubrey
    Customer

    I’m trying to get the previous object in a scene that was selected and the material changed for highlighting to go back to its original material when another object is selected.
    When someone is on a computer its fine as I have this sorted by ‘when hovered:do’ and ‘out:do’. Works as expected.
    When a user is on mobile those object will not change, of course, so I have the selected material to change ‘when clicked’. It changes, but stays that material. I have tried where it first changes all objects back to the base material then assign the material to select but that doesnt work and all will stay that base colour. I have tried the ‘if missed: do’ and it doesnt work like i need it either. Any other ideas on how I can assign a material to all other objects in a group besides the one that was clicked?

    #55231
    kdv
    Participant

    Create a new variable prevObject and on the event when clicked set this variable to pickedObject. When you click another object just change the material for prevObject and re-assign prevObject to pickedObject again.

    P.S. There is one feature with materials: if you assign a new material to an object, the previous object’s material will disappear from the scene if it’s not used by any other object and you can’t assign it back. The workaround is to have in the scene an invisible dummy object with the same material.

    Puzzles and JS coding. 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 the meaning at all.

    #55248
    Aubrey
    Customer

    You know, I thought I was being smart as I had a hidden dummy object with the material but of course I was changing the material of a group and the dummy was in that group. Took the dummy out and all works as it should. Thanks for your help.

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