Gravity problem, collision detection between two physic object

Hello folks,

I having an issue:
I have objects going up which I have attached to the physics engine (physics.addBody() ). All is good so far. Now, the problem is that I have a sprite object I want to be able to collide with these spawned
objects going upwards. All works well but the sprite is also going upwards like the objects, which is something I don’t desire to happen. Naturally, this behavior is to expect since I had to attach the sprite object to the physics engine as well, so I can get the collision detection working. But this also makes the sprite object to be influenced by the gravity.

I am stuck. I know there’s a way to make this work, but I can’t seem to figure it out.

Any help is highly appreciated my friends.
Thanks in advance. [import]uid: 75258 topic_id: 22417 reply_id: 322417[/import]

Hey Paulo, hope you’re well :slight_smile:

What do you want to happen when it collides with the other objects? Should it react, be pushed off course, etc?

What are the other objects? Dynamic, I presume?

I am wondering if a static object (sensor) may work for your sprite.

Is that an option?

Peach :slight_smile: [import]uid: 52491 topic_id: 22417 reply_id: 89391[/import]

Hello Peach!! :slight_smile:

I am doing well, and you? Thank you so much for responding to my post.

Anyway, yes, the objects are dynamic. "Static object (sensor) " may work, except I am not exactly sure how to implement it. I have, though, implemented the static object like : physics.addBody(object,"static"...) --(pseudo-code and it made it so that all other objects ( coming upward) changed their paths, or went around the static object, which is something I dont want.

When it collides with the other objects, I want it to react and pushed off course and then I would also create some sort of explosion (the explosion stuff I can do no problem, once I harness the event). Am I making any sense?

Thanks Peach. [import]uid: 75258 topic_id: 22417 reply_id: 89402[/import]

I’m well thank you - a little sleepy from the 48 Hour Challenge going on this weekend but all good :slight_smile:

Yeah, for this static sensor wouldn’t work that great as it needs to be pushed off course. Hrm.

Am going to look at your other thread relating to this and comment further there :slight_smile:

( For anyone looking at this in the future; http://developer.anscamobile.com/forum/2012/02/26/upward-and-downward-objcts-same-screen ) [import]uid: 52491 topic_id: 22417 reply_id: 89422[/import]