Is it possible to change the physics of a dynamic object to a static (I know that in the properties of physics there is a parameter Static, Dynamic, ?

Hello!

Is it possible to change the physics of a dynamic object to a static (I know that in the properties of physics there is a parameter Static, Dynamic, Kinematic)?

I need this in order to count the collision of two static objects, because 

As noted, some body types will — or will not — collide with other body types. In a collision between two physical objects, at least one of the objects must be dynamic, since this is the only body type which collides with any other type.

Thank you in advance    :slight_smile:

  1. You can change the body type of a physics object.

  2. Static objects do not collide with other static objects.  They can’t move.

  1. You can change the body type of a physics object.

I know that in the properties of physics there is a parameter Static, Dynamic, Kinematic

Ok, I ask the question differently, is it possible to make the dynamic object not interact (not jump, not bustle and etc) with a static object? (BUT I NEED THAT THE COLLECTION OF THE VOLUMES COUNT OUT)!

Your question isn’t as clear as you may think.

After a physics object has been created, you can no longer change it. If you want to turn a static object dynamic, then you’d need to delete the physics body and create a new one with a dynamic body to begin with.

The reason why two static objects can’t collide is due to computational efficiency based on the assumption that if an object is static, then it shouldn’t be moving in the first place, i.e. it shouldn’t be able to collide with another static object.

What you could do is create a dynamic body but turn it into a sensor. If your app uses gravity, then set the object’s gravity scale to zero. This way the object will be able to detect collisions with other objects, but won’t physically collide with them (and will be unaffected by the possible gravity).

Thank you for reminding me about the sensors. I forgot about them. 

I looked at this topic:

https://forums.coronalabs.com/topic/74087-any-threads-on-how-to-make-a-score-counter-for-every-dodge/?hl=issensor#entry390575

I had to add these values to the physics of my hero so that everything would work as it should.

physics.addBody( hero, "dynamic") hero.gravityScale = 0 hero:setLinearVelocity( 0,0 ) hero.isSensor = true

I just wanted that the object counted the collision itself, but not physically.

Sorry for my English.

THANK!!!  :slight_smile:

  1. You can change the body type of a physics object.

  2. Static objects do not collide with other static objects.  They can’t move.

  1. You can change the body type of a physics object.

I know that in the properties of physics there is a parameter Static, Dynamic, Kinematic

Ok, I ask the question differently, is it possible to make the dynamic object not interact (not jump, not bustle and etc) with a static object? (BUT I NEED THAT THE COLLECTION OF THE VOLUMES COUNT OUT)!

Your question isn’t as clear as you may think.

After a physics object has been created, you can no longer change it. If you want to turn a static object dynamic, then you’d need to delete the physics body and create a new one with a dynamic body to begin with.

The reason why two static objects can’t collide is due to computational efficiency based on the assumption that if an object is static, then it shouldn’t be moving in the first place, i.e. it shouldn’t be able to collide with another static object.

What you could do is create a dynamic body but turn it into a sensor. If your app uses gravity, then set the object’s gravity scale to zero. This way the object will be able to detect collisions with other objects, but won’t physically collide with them (and will be unaffected by the possible gravity).

Thank you for reminding me about the sensors. I forgot about them. 

I looked at this topic:

https://forums.coronalabs.com/topic/74087-any-threads-on-how-to-make-a-score-counter-for-every-dodge/?hl=issensor#entry390575

I had to add these values to the physics of my hero so that everything would work as it should.

physics.addBody( hero, "dynamic") hero.gravityScale = 0 hero:setLinearVelocity( 0,0 ) hero.isSensor = true

I just wanted that the object counted the collision itself, but not physically.

Sorry for my English.

THANK!!!  :slight_smile: