Get object from another scene [SOLVED]

  • #1, by red363Monday, 22. August 2022, 03:41 A year ago
    Hi!

    Can you please tell me if it is possible to use objects from one scene in another scene? Let's say I have a generic object for different scenes, which I put in the "warehouse" scene.
    I tried this script but it doesn't work. Perhaps a syntax error?

    local p = graphics.getParticles(Scenes["name"].SceneObjects["name"])
    local pos = getCursorPos()
    p.center = {pos.x,pos.y}


    Thank you.

    Forum Fan

    101 Posts


  • #2, by afrlmeMonday, 22. August 2022, 03:45 A year ago
    Did you extract that from the curves example? That's something to do with a particle system linked to a scene object.

    You can duplicate objects with script, but I don't know if you can choose which scene to place them into. It would be easier to copy & paste the scene object into each scene you want it to be in & assign a condition or value to each one to control which scene it should currently be displayed in  - even if it's  something  the  player can pick up & add to their inventory, I'm going to recommend using a value as you only need the 1 value for all of the different instances of the generic object throughout the different scenes & you can query in the object properties if value equals 1, equals 2, etc & if the player takes the object & adds it to  their  inventory then you can set the value to -1 to hide it from all of the  scenes.

    Imperator

    7278 Posts

  • #3, by red363Monday, 22. August 2022, 17:09 A year ago
    Yes, particle system linked to a scene object. Thanks for the reply, I'll do as you wrote.

    Forum Fan

    101 Posts