2
votes

I am currently working on making a little game with Corona. I am wondering how to make a collision detection with a physics object and a non-physics object in Corona. I want it to be so when the physics object touches the non-physics object an event will happen.

Thanks in advance!

2

2 Answers

2
votes

You can't use physics based collision detection to detect collisions with non-physics bodies. However you can use some techniques outside of physics to see if two bodies are bumping into each other.

It requires a different way of thinking about it. This tutorial should assist you in non-physics collision detection:

http://coronalabs.com/blog/2013/07/23/tutorial-non-physics-collision-detection/

0
votes

Corona uses Box2d physics engine, so you can only get collision events between objects registered with the physics module. However, a registered object can have a body type of "static" in which case it does not move, but objects of dynamic and kinematic type that collide with static physics objects will generate collision events. Take a look at Physics Bodies and Collisions and try the samples there. If you have more questions post specific questions.