[BUG] Animation change breaks revolute joint

Bugs will be moved here once resolved.

Post » Mon Feb 06, 2012 9:39 pm

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...
B
12
S
2
G
5
Posts: 20
Reputation: 4,032

Post » Mon Feb 06, 2012 9:45 pm

It has to do with :
[quote]Bug 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.
[/quote]

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.Kyatric2012-02-06 21:48:33
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,998
Reputation: 57,791

Post » Mon Feb 06, 2012 10:04 pm

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?
B
12
S
2
G
5
Posts: 20
Reputation: 4,032

Post » Mon Feb 06, 2012 10:26 pm

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.
B
12
S
2
G
5
Posts: 20
Reputation: 4,032

Post » Mon Feb 06, 2012 10:39 pm

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". - All the hard work on the gameplay down the pan because the game idea is not viable with revolute not working smoothly.
B
12
S
2
G
5
Posts: 20
Reputation: 4,032

Post » Mon Feb 06, 2012 10:55 pm

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.
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,478

Post » Tue Feb 07, 2012 7:26 am

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.
B
12
S
2
G
5
Posts: 20
Reputation: 4,032


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 5 guests