Serious collision bug (or else, very odd behavior)

In my latest round of testing, it appears that physical bodies do not “track” their parent objects when those objects are involved in a movement transition. Is this “normal” behavior or a bug?

For example, in my game, I output a few enemies at random to the screen, and attach the proper physical bodies with all of the correct collision filters (this is not a filter issue, I’ve done this many times before). The issue comes in when I MOVE those enemies in a transition… in this case, I have the group of enemies (in their own displayGroup) moving to the left in a basic transition, i.e. x=moveGroup.x-2000.

What appears to be happening is that the enemies move, but their physical bodies do not move… even though with “hybrid” physics display turned on, those bodies appear to be attached. It’s almost like the bodies are locked in their starting X/Y positions from a sensory standpoint… I can actually move another character (Player) to where the enemy’s physics body was initially and get some collision response, even though the enemy and its physical body have moved to the left!

So is this a bug? Or does Corona not like physics bodies being moved in a transition? This is extremely frustrating for me, because I’m working on a side-scroller type game, with enemies moving across the screen right-to-left, using a long motion transition. But the Player character resides in a separate group and thus does not become part of the transition. The enemies sense each other because (I suppose) their physics bodies were declared in relation to each other. But the Player doesn’t sense the enemies because the physics bodies’ “location” seems to be all confused by the transition.

Ansca, please help! This is a major roadblock in my game, and I’d like to understand what’s going on…

Thanks!
Brent
[import]uid: 9747 topic_id: 4371 reply_id: 304371[/import]

Further update: it’s definitely true. I placed a physics object on the screen, then added that object to a displayGroup (or vice-versa, I can add it to the displayGroup first then apply its physics body, the order of these two actions seems not to matter).

Then I move the displayGroup using a basic transition. A “ghost” physics body is left behind the object, unmoving from its initial X/Y position, and the moving object no longer has an active sensory body attached. Although it appears the body is following the object when viewing a wireframe/hybrid physics display, it’s clearly not doing so. Collision interactions occur where the body first began (on the ghost body) but they don’t occur as the object refreshes its position across the transition span…

Very odd indeed! Anybody else encountered this? [import]uid: 9747 topic_id: 4371 reply_id: 13659[/import]

According to the docs you can get weird results with the physics engine if physical objects are in different display groups. Also, quoting from the docs:

“NOTE: While the physics debug draw renderer should correctly account for physics objects in nested display groups, it will display misleading results if display groups are rotated or scaled. This will be addressed in a future release.”
[import]uid: 9422 topic_id: 4371 reply_id: 13677[/import]

Hi Brent,

You sent me an email about this issue, and the solution I proposed for you doesn’t rely on movement transitions. If you decide to go with that, this problem you’re having shouldn’t be an issue for you.

Otherwise, I’ve never used a movement transition on a physical object that needed to register collision events so I wouldn’t know if there is/was a bug with it.

Let me know if the solution I proposed (moving x/y values with an enterFrame listener) works for you. [import]uid: 7849 topic_id: 4371 reply_id: 13699[/import]