How do properly scale entire family with Physics objects in runtime?

0 favourites
  • 3 posts
From the Asset Store
A collection of various zombie characters sprites for creating a 2D platformer or sidescroller game
  • Hi,

    I have family with chain made by Physics revolute joints and trying to increase or reduce chain size in runtime.

    Tried a lot of options (Pin, Hierarchy, set positions, ...), but every time it come into conflict with Physics behavior.

    After that I tried with making Physics objects immovable and it worked during scaling, but after making objects movable, after scaling, at first they behave a little strangely, with some extra forces, before they stabilize, but that doesn't suit me.

    At the end I tried with scaling entire Layer and it works fine but, it changed layer positions because Layer pivot points is at the center of the layout. After that I tried to move family objects, to offset Layer scale but got the same situation as before.

    What should I do? Is there a maybe way to change Pivot point for one layer only, or how to work?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Yeah, physics object don't like to be resized. Especially when there are joints between them. I think you need to remove joints, disable physics, then resize, re-enable physics and recreate joints. A pause of 1 tick (Wait 0) may also be needed before you enable physics.

  • Hi dop2000, thank you for your answer. I tried and this too, but disabling / enabling physic and recreating joints always spoil the natural movement of the objects (some smaller and simpler objects can pass but complicated physics groups, with a lot od joints, make a mess).

    I still want to work with physics, but I think I will give up resizing objects and changing their positions by set position.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)