How to resize a collision/trigger collision box at runtime?

I want to be able to increase the range of my gun during runtime. So if someone chooses to upgrade range it will upgrade the trigger collisionobject radius. But that doesn’t appear to be possible at runtime unless I scale the entire object larger. But then the sprite is larger too and I don’t want this.

What is the best way to achieve this in defold?

Do I need to rescale the entire game object then rescale the sprite back to normal size?

1 Like

@jhonny.goransson has an ongoing task to allow resizing of a collision shape. Not sure when we will be able to release it though

Your best bet is to have the collision shape in a separate game object along with a script to catch the collision message and forward it to the rest of your game logic.