Scaling Collision Object when Game Object is scaled (DEF-521) (SOLVED)


I have created a platform(as a game object) that is to be used as a building block throught out the whole game. The problem is that the collision object associated with the platform does not scale when the platform is scaled in the collection file.The sprite scales as required but the collision object stays the original size. This is creating a problem. According to me when a game object is scaled, all children elements should be scaled accordingly.


Changing size of an object
Physic body scale issue? (DEF-521) (SOLVED)
Making a Rogue-like game in Defold
TileMap Collision Scaling
Big list of feature requests based on our experience on Ludum Dare
Back to Defold after 2 years, "Bouncy Catapult" hypercasual prototype
Defold 1.2.156 has been released
Cutting objects and letting them fall "naturally"
Big list of feature requests based on our experience on Ludum Dare

Bump! No input on this?

1 Like


We’ll look into this. Thanks.

1 Like


I found an issue on this in the backlog. I’ll see if it can be prioritized.


How do you dynamically scale collision object and/or dynamically remove part of a spine scene with script
How to set size of collision object by script

I just encountered this problem as well.

The collision objects do however get scaled if you specify a scale with factory.create, but not when you do it via go.set_scale.

Maybe bump this up to a bug instead of a question?



I’ve attached a Jira ticket id and moved this to bugs.



Is there any update on this bug? Ive just ran into this as well. Ive tried setting game object scale with factory.create and go.set_scale and neither set the attached collision object shape scale.

Whats the work around for this at the moment? I know I could manually set the Box Shape width and height in the editor, but could I access the Box Shape’s width and height from the parent game object?




any news here? or atleast an idea for a workaround?


Random geometric shapes

There is no general workaround that I know of but there might be for specific use cases.

1 Like


I was in the middle of typing a post on this then this thread came up under similar. The problem seems to be that the orange outline for the collision object does not scale up or down when the game object is scaled. However, when the game is run the collision object is scaled.



Any news on this? It’s pretty huge to not be able to scale the collider with the GO.

1 Like


No new news I’m afraid.
It was considered some time ago, but turned out to be more complex than what was initially thought.
Since the community is still requesting this, it will increase in priority.
However, I cannot give you an e.t.a. at this point.



This bug blocks fast prototyping, when you don’t want to use tile map. ):



I’m missing the ability to dynamically alter my collision object size too. For example i want to create a shockwave which expands and hits objects at it’s border.

1 Like


There is an existing workaround to get scaled collision. You must create new objects based on factories with a set scale. Then you delete the older. And need something to manage the creation / deletion based on scaling. Or keep the various scales and only disable / enable their collision sizes as they are needed if you have only so many possible scales. Obviously is messy, but if you need dynamically scaled collisions this is a way right now. Works with factory / collection factory.

    collectionfactory.create("#groundfactory", go.get_position("."), go.get_rotation("."), {}, 2)
    collectionfactory.create(url, [position], [rotation], [properties], [scale])

Set_scale on collision objects?

Regarding scaling of collision objects through factory.create;

Right now it appears that scaling is applied when using a number as scale parameter - but not when using vector3?



Yes. you can use vectors to scale. Collisions will not scale along unless the scaling is uniform though:

factory.create(component, p, nil, {}, vmath.vector3(8, 1, 1))

factory.create(component, p, nil, {}, vmath.vector3(8, 8, 8))



I understand not being able to non-uniformly scale spheres, none of the other engines I’ve tried have allowed that, but scaling boxes would be great. Or at least some way to create and add a new box shape of different proportions. That seems to be the one thing you can’t work around right now.

1 Like


The workaround is that if the scale-factor is uniform along all axes (x, y, z), then the collision object seem to scale correctly. I encountered the same issue with scaling sprites and connected trigger object.

This is mentioned by @sicher a bit down the thread, but not explicitly mentioned as a workaround for the issue, so…
Am I missing something?



Yes, I meant there’s no workaround for non-uniform scaling.


Collisions are ignored (SOLVED)