I have a strange issue with z position after a scale. Maybe I am missing something very basic here, but I would say that the z position of a child object is wrongly computed if the parent object has a scale. Let me explain a bit in details.
- I have created a “Basic 3D project” from the template.
- In the main collection I have added a child go to the “main” go and I have called it “TEST”
- I have set the scale of TEST to 2.0, 2.0, 2.0 (uniform 2.0).
- I have added 3 game objects to TEST, each with a model component with model the builtin cube; these go’s are “go_0”, “go_1” and “go_2”.
- I have set the position of these 3 go’s to be: 1.5, 0.0, 0.0 — 1.5, 15.0, 0.0 — 1.5, 1.5, 1.5 respectively
- I have added some lines to main.script in order to print the world positions of these 3 go’s: and I see
DEBUG:SCRIPT: vmath.vector3(3, 0, 0)
DEBUG:SCRIPT: vmath.vector3(3, 3, 0)
DEBUG:SCRIPT: vmath.vector3(3, 3, 1.5)
It seems to me that the z position of go_2 should be 3.0 and not 1.5… It seems that the engine is not taking into consideration the scale of the parent object when it computes the z positions of the child objects.
Please note that, when I run the project, I can confirm that go_2 is in a wrong position. But the scales of the objects are all fine. Also, in the editor the positions are all fine.
I am really surprised by this error. Let me say again, maybe I am missing something. It is a very basic setting and I am using a template project.
Version 1.9.2
editor sha1: 8a5478f8b67306dcc6b3e6ebf33e3b3114e430fd
engine sha1: 3251ca82359cf238a1074e383281e3126547d50b