preCollision and event.contact.isEnabled

I’m getting just a few weird responses when using the preCollision and even.contact.isEnabled = false. I was wondering if this skipping was a part or how I could prevent this from happening. 

local function preCollision( self, event ) if event.other.y \< self.y then if event.contact then event.contact.isEnabled = false end end end

Hi @lofy,

I can’t tell what is happening in the video, or how it relates to preCollision and event.contact. How are you moving those objects? Are they moving under typical physical forces or are you trying to override that with transitions or enterFrame movement? What types of objects are they and what type of physical bodies?

Basically, we’ll need more code to begin figuring out what might be the issue here…

Thanks,

Brent

They are “dynamic” physics objects that are moving with one setLinearVelocity().

Still not sure what would be causing the skip. Did you look at the “PhysicsContact” sample project bundled with Corona? That has no issues with skipping and shows a code base for using the event contact. It’s located in the Corona application folder here:

SampleCode > Physics > PhysicsContact

Brent

Hi @lofy,

I can’t tell what is happening in the video, or how it relates to preCollision and event.contact. How are you moving those objects? Are they moving under typical physical forces or are you trying to override that with transitions or enterFrame movement? What types of objects are they and what type of physical bodies?

Basically, we’ll need more code to begin figuring out what might be the issue here…

Thanks,

Brent

They are “dynamic” physics objects that are moving with one setLinearVelocity().

Still not sure what would be causing the skip. Did you look at the “PhysicsContact” sample project bundled with Corona? That has no issues with skipping and shows a code base for using the event contact. It’s located in the Corona application folder here:

SampleCode > Physics > PhysicsContact

Brent