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.

mrgna

Forum Replies Created

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • in reply to: Measure distance between objects #71441
    mrgna
    Participant

    Sorry, Im not very good at coding so I don’t really know how to explain the issue :mail:

    From the javascript I have written, I push the object name into an array when someone clicks on the div to set it as either “Measure Object 1” or “Measure Object 2”. From there I am hoping to use the string in that array to reference to an object in the scene.

    I have attached some photos of the green div buttons I am talking about clicking, and a snippet of my code so you can see how I am moving the info around. Im clearly doing something wrong as my output is always text :scratch:

    But even with all this, since the array has the correct text (the previously printed console text)- shouldn’t it work anyways when I try to refer to an object by the array? I feel like I am missing something very obvious :unsure:

    Sigh… I was missing something stupid.

    Nevermind, ignore all of this please.

    in reply to: Measure distance between objects #71435
    mrgna
    Participant

    Sorry, Im not very good at coding so I don’t really know how to explain the issue :mail:

    From the javascript I have written, I push the object name into an array when someone clicks on the div to set it as either “Measure Object 1” or “Measure Object 2”. From there I am hoping to use the string in that array to reference to an object in the scene.

    I have attached some photos of the green div buttons I am talking about clicking, and a snippet of my code so you can see how I am moving the info around. Im clearly doing something wrong as my output is always text :scratch:

    But even with all this, since the array has the correct text (the previously printed console text)- shouldn’t it work anyways when I try to refer to an object by the array? I feel like I am missing something very obvious :unsure:

    • This reply was modified 8 months, 2 weeks ago by mrgna.
    • This reply was modified 8 months, 2 weeks ago by mrgna.
    Attachments:
    You must be logged in to view attached files.
    in reply to: Measure distance between objects #71430
    mrgna
    Participant

    I tried that already :(

    Here is the output with the modification you mentioned:

    Could it be because the variables are arrays?

    • This reply was modified 8 months, 2 weeks ago by mrgna.
    Attachments:
    You must be logged in to view attached files.
    in reply to: Measure distance between objects #71411
    mrgna
    Participant

    Can someone please help me understand why this is not working correctly? I have linked the puzzle I am using, as well as the output.

    I am using javascript to get the names of the objects that are being used in the pictured example… But how do I get a numerical output instead of just text?

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

    Thank you very much! I wasn’t anticipating having to use Javascript for this, so I was going crazy looking around in the menus for something :wacko:

    I’ll have to brush up on JS. :good:

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