Search Unity

import objects during runtime

Discussion in 'Scripting' started by ARuReady, Jun 14, 2019.

  1. ARuReady

    ARuReady

    Joined:
    Jun 5, 2019
    Posts:
    4
    I am trying to make the following simple application: Import an assembly of objects, apply physics to the objects, look if one of the objects moves and if it moves send that info to a python script.

    In order for this application to work I would have to control unity with an external script and I should be able to import different assemblies in the game. I am struggling with both issues, but let's start with the second one. How can I make the user choose which assemblies are imported in the game? The problem is that I cannot define on beforehand what is in the resource folder as I do not know what assembly the user will want to import.
     
  2. palex-nx

    palex-nx

    Joined:
    Jul 23, 2018
    Posts:
    1,748
    Default way to import assets in the player is AssetBundles. But asset bundles requires to be compiled for target platform. Your best bet would be to use some kind of game object serialization plugin from asset store or wirte your own game object serializer.
     
  3. ARuReady

    ARuReady

    Joined:
    Jun 5, 2019
    Posts:
    4
    Would it be an option to never really compile the game? So that you actually just run a script in the editor as you do before compilation? Because then you can still add objects