Possible bug is physics joints?

Bugs will be moved here once resolved.

Post » Thu Oct 18, 2012 11:10 pm

I asked a question about a game I'm working on. It involved a ship attaching to a block via a physics joint. The problem was, when you thrust up the screen with the block attached, the block moved gradually closer to the ship until it eventually was above it.

User R0j0hound mentioned it could be a bug with the physics joints. He's far more clued up than I am with the technical side of things, so just in case it is a bug, I'm posting it here.

R0j0hounds reply [quote]It looks like it's a bug with joints. I landed on a higher ledge and the orange box just sat above the rocket like you said. The joint offsets aren't the same at different positions.[/quote]
Here's a demo of the CAPX showing what I mean. Move the ship above the block, then thrust up the screen and you'll see the problem.

System Spec

AMD 645 Athlon X4 Black Edition
4mb RAM
Nvidia 560 ti graphics card

Windows 7 64

Google Chrome Version 23.0.1271.40 beta-m (have tried with none beta version too and IE9)


DEMO

And here's the CAPX so you can have a proper look at what's going one.

CAPX

Cheers.

EDIT just added system specs and browser info etc. vandinz2012-10-20 20:15:06
B
19
S
5
G
4
Posts: 208
Reputation: 3,960

Post » Mon Oct 22, 2012 2:53 pm

Your .capx link is a 404. Please make sure the link works!

Note: I already think it's unlikely this can be fixed, because we don't have any code to do with joints beyond telling Box2D to create a joint, and the rest is handled by Box2D. So it may be a Box2D bug. Also, if you are using non-physics behaviors or moving physics objects with events, we can't support this case, because it conflicts with the Physics behavior and we always recommend you don't do that.Ashley2012-10-22 14:53:23
Scirra Founder
B
359
S
214
G
72
Posts: 22,951
Reputation: 178,578

Post » Mon Oct 22, 2012 3:37 pm

That's weird, the link was working the other day. Re-uploaded it now. I understand what you're saying about it being out of your hands, if you can confirm it's probably a Box2D bug I could message them maybe and see what they say.

Cheers.vandinz2012-10-22 15:37:54
B
19
S
5
G
4
Posts: 208
Reputation: 3,960

Post » Mon Oct 22, 2012 4:17 pm

@Ashley I've fixed it ... sort of. The ship was an animated sprite, made up of four frames. When I remove the animation, it works fine. I've double-checked the image points are all the same, they are. Can you not use animation with physics objects?
B
19
S
5
G
4
Posts: 208
Reputation: 3,960

Post » Mon Oct 22, 2012 5:14 pm

@vandinz - yeah, animation doesn't really play nice with the Physics behavior because it has to re-create the body every animation frame in case the size, collision mask, origin or image points are different. You can work around it by using non-animated objects with the Physics behavior and pinning an animated sprite on top of that. Not sure if we can fix this otherwise...
Scirra Founder
B
359
S
214
G
72
Posts: 22,951
Reputation: 178,578

Post » Tue Oct 23, 2012 12:24 am

OK np, that's a good solution I could use. Thanks for taking a look.
B
19
S
5
G
4
Posts: 208
Reputation: 3,960


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 2 guests