Tool mode is dangerous, there should be separate script for editor only. #4306
Replies: 2 comments 7 replies
-
As someone who uses tool mode extensively, my vote is no. Yes, sometimes I need separate stuff for editor (e.g. debug drawing) but equally as often I'll need things to happen both in game and in editor, e.g. when generating game levels (doubly so as things spawned in editor by default don't have an owner set, meaning you don't see them in the scene tree and they don't serialize)
|
Beta Was this translation helpful? Give feedback.
-
You can use |
Beta Was this translation helpful? Give feedback.
-
Instead of having one script for both editor and the engine that shares code and can introduce bugs into your game, there should be separate script for editor logic and separate script for game logic. that way the logic stays separated, there is smaller chance of bugs occurring and it probably also has performance benefits.
On export/testing the scene, the editor code would be discarded in favor of the game script.
Beta Was this translation helpful? Give feedback.
All reactions