[BUG] Animation change breaks revolute joint

0 favourites
  • 7 posts
From the Asset Store
Simplistic hyper-casual game with nature elements. Tap to switch between the 4 elements and reach a better score.
  • HELP....

    Downloaded r78 and found that the revolute joint breaks when either animation frame changes or animation set changes. Trying to roll back to r77 but having some problems...

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • It has to do with :

    ug Fix

    Physics: now supports objects changing animation frames, but note this causes a "teleport" in the physics world (similar to when using 'set position') and should be used with care.

    The note is important. The fact of changing the animation frame on an object with physic is equivalent to spawning a new instance of it.

    So on each animation frame change, you should re-create the revolute joint.

    Edit: another workaround would be to have the physic behavior on an invisible sprite and display your "support" object's animation in a strictly visual sprite (if you know what I mean). This way, the support's frame would never change and you wouldn't have to re-create revolute joints and still be able to have the nice animation.

  • Whoa... I sort of get it but it makes things more complex. The bug fix looks like it does the opposite of what it says... i.e. it looks like physics no longer support changing frames or do you mean forcing the frame change? What was the bug?

    So - I either need and event... object on frame changed...recreate joint... or I need an event to keep the support 'facade' image point at the same x/y as the support itself. Is that right?

    Which it the most efficient cpu cycle-wise?

  • OK so neither of these techniques work.

    Object - On Frame Changed - Create joint = joint still breaks

    Support... instead of the smooth jointed swing I had before it's all jerky and the joint acts like it's limited..

    As it stands, development on my game (which relies on the joint) is gonna stall completely. I have to change the animation at some point.

    Any ideas?? Don;t wanna go back to r77 because the family vars and particles are so cool.

  • Further update - I got the thing to stay together using the frame change reconnect technique but now it stretches oddly away from the connection image point the more it swings around and also seems really "stiff". <img src="smileys/smiley13.gif" border="0" align="middle" /> - All the hard work on the gameplay down the pan because the game idea is not viable with revolute not working smoothly.

  • The physics collision mask didn't update when the animation changed in r77 - this was a bug and was fixed. However, there's another bug that whenever the collision mask is updated (e.g. changing the object size or, now in r78, changing the animation frame) then all joints are broken. Sorry, I'll try and get that fixed for the next build :-\ in the mean time don't try to work around it by creating joints more than once, otherwise when it's fixed you'll end up creating multiple joints which will probably break the physics engine.

    TBH animating objects with the Physics behavior isn't a good idea, because changing to an animation frame with a different collision mask enables glitches where the object is suddenly stuck inside another one due to the different collision shape.

    A good workaround in the mean time might be to use invisible objects with the Physics behavior, which never change animation frame. Then, place your animated objects on top.

  • Thanks Ashley, that's good news. I might revert to r77 for now as I'll have less to do once the bug is fixed (though the particles are tempting). Agree about animating physics objects. In the context I'm doing it, the collision mask is - as near as possible - identical between frames. Gonna experiment further with the 'support' idea though as it may come in useful.

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