Godot Version
4.5.1
Question
When you scale nodes in Godot, the position of the node stays in the center, and the scale on the axis scales outwards. In other engines and software, there are options to be able to scale on one axis in one direction, for example, scaling a node only on +Z, etc. It’s hard to describe, thus I am asking here because my research efforts haven’t gone right. This kind of functionality I am looking for is present in CSGBox nodes, however, for my purposes, I cannot use a CSGBox. I need all Node3Ds to be scalable not from the center, but from the origin point of the axis you choose. The best way I can describe it is stretching a Node3D or pulling a Node3D towards a certain direction.
I tried to create an Editor Plugin, however everything I tried and every code I tried for an EditorNode3DGizmoPlugin that I could find seemingly did not work and had a multitude of issues, furthermore it was just really really really complicated, not much info or tutorials about it. I searched for github projects for examples, but nothing worked, there were always errors like “Condition !material.has(p.name) is true Returning ” or something vaguely along those lines, spamming my console.
I also tried to use _notification in a tool script to run code everytime I scaled an object. I made a var for the last scale variable and detected if the new scale was not the same as the last scale, then position -= (last_scale - scale) * 0.5 to set position based on the offset, however this did not work as the position kept snapping back to the center even though I was changing it. A lot of bugs and unintended behaviour from the looks of it, for such a simple feature to want.
I was a bit frustrated so I don’t have any code examples, I’m just asking for help as a last resort. It seems as if the answer is just around the corner, but everything I try unfortunately fails. It would actually be cool to have a working custom gizmo that didn’t scream errors at me or spam lines everywhere for some reason, or say that it cannot find a material even though it clearly has it. If anyone is reading this, please let me know if you have a solution to this, thanks.


