Get object from another scene [SOLVED]

  • #1, by red363Monday, 22. August, 03:41 A month 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.

    Newbie

    81 Posts


  • #2, by afrlmeMonday, 22. August, 03:45 A month 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

    7183 Posts

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

    Newbie

    81 Posts

Write post