Hot reload script properties (DEF-2863)

This is a feature request for hot reloading changed script properties in order to see changes live when tweaking from the editor. It’s the result of the following original question:

Is hot reloading collections planned in the future?

Or is there another smart way to solve the following problem:
I have a rotating arm. I exposed the rotation speed via a property but there’s no way to see my changes immediatly.

If this arm occures only in one place of the game I would just define the speed in the script and hot reload the script but since it’s instance dependend this won’t work.

Any input is appreciated!

You can make input from keyboard.

Example about it - https://www.defold.com/examples/input/text/

In example text placed on Label, but you can usage it in game process.

1 Like

That’s basically the same as in script with hot reloading - still doesn’t solve my problem. With this approach we would still set the value for all instances or am I wrong?

Edit: If I use an external script to enable input only on a certain instance then it might solve the problem but this wouldn’t be pretty :smile:

Why doesn’t solve - you recieve data from keyboard and send data to you collection in game process without any restart.
I right understand you try change speed for special collection or for all collections?

I want to change the speed only for a special collection (or more precisely for one instance of a game object in a collection). But I think I might have misunderstood you - you would add this script only to the instance that you want to change - right? Then it might solve the problem actually.

Yes. For instance or for any object.

You can send message from any script to any object/collection in project.

For example: we have script #script1 in game object /go1 and in collecion /coll1. We want send message to #script2 in /go2 in /coll2

we send message from #script1 msg.post(coll2:/go2#script2,“hello”,{message = “Hello from script1”})

And for additional - you can send one message to any countobjects

Okay yes, this would work. Thanks for pointing this out! I will try it out as a solution. But my main question should properly be answered by a dev: “Is hot reloading collections planned in the future?” :smiley:

Collections doesn’t exist at runtime so there is nothing to hot reload. Collections are just a way to group game objects and quickly spawn groups of game objects (collection factories) or load groups of game objects (collection proxies). You can hot reload the individual game objects though.

1 Like

How can I reload individual game objects?
And maybe to rephrase my question a bit: is there a way to see changes of a editor property (which is exposed from script) in realtime?

No, I’m afraid not. You can change values in a script, but you cannot hot-reload a script property that is changed from the editor.

1 Like

Well - consider this a feature request :stuck_out_tongue_winking_eye:

Created a feature request ticket: DEF-2863

1 Like

I moved this to feature request or shouldn’t I? I don’t know if this is the correct way to handle this :smile: Or do you have a seperate place for the request tickets?

That’s fine. It’s tracked internally as a feature request and it’s always nice if the forum reflects this.