A simple question.
What i am wrong here?
I have a RigidBody with mass zero: sceneBody
and a RigidBody which collide with it: bodyC
and i want to permanent check the contact between this two objects
bodyC.addRay(new Vector3D(0, 0, 0), new Vector3D(0, -250, 0))
bodyC.addEventListener(AWPEvent.RAY_CAST, checkContact)
private function sphereRayCast(event: AWPEvent) : void {
if (event.collisionObject == sceneBody) {
myText.text = "CONTACT"
}
if (event.collisionObject == null) {// of course a NON PROGRAMMING script but ...only for exemplification
myText.text = "NON CONTACT"
}
}
I just cannot find a way to have a CONSTANT CHECK of the contact and non contact
So….the stupid question..: How do i get the “null” contact…the NON CONTACT ??!!
I mean if i would have another body in scene…
private function sphereRayCast(event: AWPEvent) : void {
if (event.collisionObject == sceneBody) {
myText.text = "CONTACT"
}
if (event.collisionObject == otherBody) {
myText.text = "OTHER BODY CONTACT"
}
}
...this work…
but again…how did i get the “non contact”