Search Unity

In game editing of game objects variables

Discussion in 'Scripting' started by disaldo, Jun 21, 2015.

  1. disaldo

    disaldo

    Joined:
    Apr 9, 2010
    Posts:
    38
    Hi

    Is it possible to allow the player to amend an objects variables whilst the game is running as a built version ie not in editor.

    The reason I am asking I am trying to try and find a way to teach very young students how to code by amending the code in game ie change an objects velocity (something like the way you can do stuff in Garrys Mod.

    The school cannot afford Unity and has tried scratch but want to take things further. My concern is if the game is compiled then will the scripts be editable ?

    Any pointers would be appreciated.

    Ste
     
  2. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,860
    Editing the scripts is tough. But setting the variables via an in game interface is pretty easy. Unity has a fairly extensive UI system to make the front end. For simple stuff hard code it. For complex stuff you can use reflection.

    Note there is something to the effect in the EULA that says you can't use Unity to make a GameEngine. I don't remember the exact wording, and it probably doesn't apply to your use, but you might want to go check it out, just in case.
     
  3. disaldo

    disaldo

    Joined:
    Apr 9, 2010
    Posts:
    38
    Many thanks I will check out reflection, I believe my requirements will be very simple and definitely not a game engine :) though I will check out the EULA/

    Ste