Subtle but confusing detail about instanced Torch nodes and offset

At 2:34, Yann sets the SecurityCamera/CameraBody/Torch Offset to (0,0). He then sets the offset in the Torch scene to (370, 0). This led me to think that I should ultimately see a Torch Offset of (0, 0) in the SecurityCamera, and an offset of (370, 0) in the Torch scene.

In other words, I thought the offset would be cumulative. That is, the Torch scene itself has an offset of (370, 0), and then the parent node would apply some other offset on top of that. (In this case an offset of (0, 0), but maybe in another case the parent would add an additional (10, 10) or something.)

That’s not how Godot does it at all. If you instance a brand new torch into a node, it brings its Offset of (370, 0) and Texture Scale of 0.5 along with it. If you change that Offset or Scale in the parent, you aren’t adding an additional offset; you’re simply setting a new Offset and Scale. I spent some time arguing with the CameraBody, setting its Offset to (0, 0) and wondering why the Torch wasn’t in the right place, before realizing this.

Again, this is subtle and I may not even be explaining my confusion adequately, but if it tripped me up I thought it was worth mentioning, in case anyone else has the same confusion.


Privacy & Terms