JS Function on appended scene object

Home Forums Puzzles JS Function on appended scene object

This topic contains 7 replies, has 2 voices, and was last updated by Yuri Kovelenov Yuri Kovelenov 1 month ago.

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #18781
    Avatar
    mexwann
    Newbie

    Hi,

    I am trying to apply a JS function to objects from appended scenes. But it seems to not working, only with object of the original scene.

    Here is the JS function example:
    app.ExternalInterface.removeObject = function(objName) {
    var obj = app.scene.getObjectByName(objName);
    app.scene.remove(obj);
    }

    And attached a picture of the puzzle example.

    I am sure it is no big deal to do this, but I can’t :wacko: … Any help would great.

    Attachments:
    You must be logged in to view attached files.
    #18791
    Yuri Kovelenov
    Yuri Kovelenov
    Developer

    Hi,

    you can use the puzzles when clicked – all object only once. Also does it work for one-scene case (when you don’t use append scene)?

    3D Verger, the CEO
    LinkedIn | FB | Twitter | VK | 新浪微博

    #18896
    Avatar
    mexwann
    Newbie

    Thanks Yuri for helping. It does work for a one scene only case.

    Only issue for objects from appended scene (with the when clicked – all object puzzle out of the procedure to not repeat).

    #18901
    Yuri Kovelenov
    Yuri Kovelenov
    Developer

    Hi,

    can you attach your project files for us to look into?

    3D Verger, the CEO
    LinkedIn | FB | Twitter | VK | 新浪微博

    #18936
    Avatar
    mexwann
    Newbie

    Here are the files. Thanks a lot!

    • This reply was modified 1 month ago by Avatar mexwann.
    Attachments:
    You must be logged in to view attached files.
    #18948
    Yuri Kovelenov
    Yuri Kovelenov
    Developer

    Hi,

    Dynamically loaded objects are added in sub-scenes parented to the main scene. So the code will be slightly different:

    P.S. I think we need a remove object puzzle.

    Attachments:
    You must be logged in to view attached files.

    3D Verger, the CEO
    LinkedIn | FB | Twitter | VK | 新浪微博

    #18986
    Avatar
    mexwann
    Newbie

    Thanks a lot! Working great. Indeed, I think a remove puzzle would be a great addition.

    #18993
    Yuri Kovelenov
    Yuri Kovelenov
    Developer

    you’re welcome! we’ll think about remove object. :)

    3D Verger, the CEO
    LinkedIn | FB | Twitter | VK | 新浪微博

Viewing 8 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic.