Collision listeners: local function sensorL\_Collide(event) if event.contact.isTouching then sensorL.collide = true if event.other.type then sensorL.groundType = event.other.type end else sensorL.collide = false sensorL.groundType = "None" end end local function sensorR\_Collide(event) if event.contact.isTouching then sensorR.collide = true if event.other.type then sensorR.groundType = event.other.type end else sensorR.collide = false sensorR.groundType = "None" end end ----------------------------------------------------------------------------------------- Enter frame: if not sensorL.collide and not sensorR.collide then isGrounded = false else isGrounded = true end print(tostring(sensorL.collide).." "..tostring(sensorR.collide).." "..tostring(isGrounded)) ------------------------------------------------------------------------------------------ sensorL:addEventListener("collision", sensorL\_Collide) sensorR:addEventListener("collision", sensorR\_Collide)
“sensorX.collide” and “sensorX.groundType” - additional non-system variables
I know about “tutorial/games/nonPhysicalCollision/index.html” but I think this a very bad approach to invent such crutches while there is already a system that should work.
Time between sensor falls from “ground” to “platform” is few frames while iterations go three times every frame by default.
Any ideas? Something missed? Something missunderstanding? Please?
ALSO <pre> and <post> collision event is NOT WORKING if object.isSensor = TRUE but works great if an object IS NOT SENSOR!!!