Scripting Help

Discussion in 'Buildbox General Discussion' started by Elite Games, Jan 8, 2020.

  1. Elite Games

    Elite Games Boxer

    Joined:
    Dec 18, 2019
    Messages:
    72
    Likes Received:
    33
    Hi All

    I want to ask how we can access other scripts variable or functions through other scripts ?

    I have unity coding experience. i want to know how to that in bb ?

    There is a example get component in api documentation but i didnot understand that how it works.
    Also can we create Custom classes ?
     
  2. jmp909

    jmp909 Boxer

    Joined:
    Feb 2, 2020
    Messages:
    28
    Likes Received:
    4
    components on the same game object, or components on other game objects?
     
  3. Elite Games

    Elite Games Boxer

    Joined:
    Dec 18, 2019
    Messages:
    72
    Likes Received:
    33
    I got it how it works. I want to grab other objects components variables.
     
  4. jmp909

    jmp909 Boxer

    Joined:
    Feb 2, 2020
    Messages:
    28
    Likes Received:
    4
    you are probably going to need to use `find` to get the other object and then access its `component(name)` and get the attributes off that....but it is likely slow to use `find` so if you're running this operation often you should look at storing these references in advance (eg when your game starts up)

    http://download.buildbox.com/buildb.../api-3.0.0.2250.html#buildbox-scene-find-name

    i'll see if i can make an example tomorrow

    can you give me an example of what you need to talk to what? eg is it just 2 objects, or is it 1 object talking to lots of spawned object etc?
     

Share This Page