bodyType talking with each other

Hello, I have a player which I would like to be “static” but is “dynamic” in its current setup, and I would like to push monsters with my weapon or my body so they would be “dynamic”. I don’t want to be able to push back boss’s so “static”. Now I needed to make my weapon something and it ended up being “static”. For it to not collide with the player but I would like the weapon “static” to collide with other non moving objects “static”.

I am using the categoryBits and maskBits for everything ranging from 0001 to 1000. 0001 being the first level and 1000 being up to the 4th level (levels being determined through MTE). I don’t have any collision problems I just want static objects to talk with other static objects under only a few certain scenarios, how can I achieve this? 

I’ve tried everything I could think of switching player to static or dynamic but the weapon being static and player being dynamic causes some knockback effects and physics effects on player…etc. Very confused on what to do. It’s confusing to describe and confusing to figure out. Any advice/tips would be greatly appreciated,

EDIT: It seems to be better when the player is “static” with a “dynamic” weapon but I get more of a slide effect when using it, but the main concern is now any boss’s need to be dynamic and the player can just push giant boss’s all he wants… and NPC’s are static so now i can’t communicate with them properly…

Static -> Static won’t communicate, however Kinematic -> Static will. Try that :wink:

Nah kinematic doesn’t collide with static only dynamic :frowning:

Bad memory then on my part!

Ok so how about using dynamic, but setting the linear damping on objects you don’t want to be moved by the collision really high?

Ex:

Boss.linearDamping = 1000 -- or more, experiment

I will see what linearDamping does. I don’t understand how corona handles two dynamic objects that cannot move each other? I can do this through linearDamping? I been using the density but that gives weird results.

I use MTE to move grid squares, linearDamping doesn’t seem to be doing anything?

Linear damping should do the trick… for instance, i had a similar situation in a game i was making. Needed two dynamic objects but i wanted one of them to be ‘static’ and not fall through the floor. Setting a high linear damping on the other object prevented it from falling.

It should do the trick in this situation too. If not, is sensors an option? On collison began either disable the contact (physical) via event.contact.isEnabled = false, or object.isSensor = true, then if you use the latter, set it back to not being a sensor in the ended phase.

Hope this helps

Thank you for the quick replies and advice Gremlin! I been testing out the sensor part, which I may have to do. I have no gravity in my game or I couldn’t get linear damping at all to work. I’m still rewritting code and switching around physics bodies to see if I can come up with a better solution to not have to do this.

Static -> Static won’t communicate, however Kinematic -> Static will. Try that :wink:

Nah kinematic doesn’t collide with static only dynamic :frowning:

Bad memory then on my part!

Ok so how about using dynamic, but setting the linear damping on objects you don’t want to be moved by the collision really high?

Ex:

Boss.linearDamping = 1000 -- or more, experiment

I will see what linearDamping does. I don’t understand how corona handles two dynamic objects that cannot move each other? I can do this through linearDamping? I been using the density but that gives weird results.

I use MTE to move grid squares, linearDamping doesn’t seem to be doing anything?

Linear damping should do the trick… for instance, i had a similar situation in a game i was making. Needed two dynamic objects but i wanted one of them to be ‘static’ and not fall through the floor. Setting a high linear damping on the other object prevented it from falling.

It should do the trick in this situation too. If not, is sensors an option? On collison began either disable the contact (physical) via event.contact.isEnabled = false, or object.isSensor = true, then if you use the latter, set it back to not being a sensor in the ended phase.

Hope this helps

Thank you for the quick replies and advice Gremlin! I been testing out the sensor part, which I may have to do. I have no gravity in my game or I couldn’t get linear damping at all to work. I’m still rewritting code and switching around physics bodies to see if I can come up with a better solution to not have to do this.