Hello!
Today i started learning how do physics work within Defold.
Everything was great, until i ran into an issue related to Game Object scale and subsequent Collision Object. I had two sprites (16x16 and 32x8), which i used in two Game Objects. Since both sprites are tiny, i used scale (x5) on both of Game Objects.
The next thing was to simply add Collision Objects(and basic shapes to them) to both Game Objects. While adding shapes i resized them so they would cover whole sprite:
The problem is: Defold doesnt scale shapes within its Gui when scale is applied in Game Object(in opposition to sprites, on which Game Object scale applies instantly in interface). So, while i thought it was the right way to use scale on the shape itself(so it would cover the sprite), it was a critical mistake to do. When i launched the project i got “sinister physics”. Thanks to that topic, i was able to find the problem using “Physics debug”.
In the end i set shape dimensions according to sprites - 16x16 and 32x8. Everything worked as intended then. Physics debug showed ideal shapes. But within Defold interface the shapes are little 16x16 / 32x8 boxes, while sprites are scaled x5.
I dont know if it’s intended to be like that or not. I read the whole physics manual and wasn’t expecting to get a such a problem.