Creating a Non-Static Static Object

I have some falling dynamic objects that when touched turn into static objects so that they stay in place. However, I still need collision detection, which doesn't work when A and B are both static objects.

So my question is, is it possible to have a dynamic object behave like a static object, i.e. its position be unaffected by gravity and collisions? If not, how else can I solve this problem?
You could turn them into sensors with zero gravity scale and/or create sensors overtop of them?
I've tried sensors. Sensors have the same problem of not being able to detect static objects.
Yeah, static and kinetic bodies do not collide with each other because of their nature (and they shouldn't). I'm assuming you need contact or collision info of two static objects that are supposed to be touching each other? Why not just save the previous info before they froze and use that info for whatever?
Quote:
Why not just save the previous info before they froze and use that info for whatever?


How so?
By copying the values into variables or another object.

What do you actually need from having two static objects colliding?
I still don't understand your statement. Yes, I could copy the information, but how does that help me detect when a static object collides with another static object?
When they are touched, they become static objects, right? So right when they become static objects, store in some variable (or whatever) so that your game (not Box2D) thinks they are still touching.

I was suggesting you could copy the information because I was assuming you needed the specific contact information, not just the fact that they should be colliding. I just don't know what you need specifically from two static objects colliding. Do you need it to register a collision response or should they move a little so they don't overlap?
Quote:
Do you need it to register a collision response or should they move a little so they don't overlap?


I need it to register a collision response. Which is why my original question was if it was possible to have a dynamic object be stationary like a static object, because I can't get a collision response out of a static object. Maybe an explanation would help.

Imagine different-colored balls falling down the screen. Different colors have different effects/affects upon touching them. Collisions are used to determine which types touch which types. One causes nearby balls to freeze, so I make the nearby ball a static object so it becomes stationary. Another ball falls nearby that, upon touching, bursts into flames and destroys the frozen ball. I also want the flames to be stationary, so I make it a static object as well. Because the frozen ball and the flames are both static, no collision is detected, thus the problem.
JesseJ wrote:
Another ball falls nearby that, upon touching, bursts into flames and destroys the frozen ball. I also want the flames to be stationary, so I make it a static object as well.
So at this point, the fire ball and frozen balls have touched? If they touch and then you make them static, they're not going anywhere so they will stay permanently touching. As jayther says, you can make a note of the collision info just before you make the fire ball static and just use that, because once you make it static, nothing will change from that point on.

Original thread: https://box2d.org/forum/viewtopic.php?t=8312