View Single Post
  #1  
Old 05-24-2010, 01:13 AM
CarlosRamos CarlosRamos is offline
Member
 
Join Date: Feb 2010
Posts: 2
Collision notifications

I'm using the collision notification mechanism in Vizard, and I want to detect if one object collides with another and apply a force if that happens. But the problem is I can't identify the object. For example, let's say I have an object called "ball", and a object called "racket" already defined and loaded previously on the script, and with the viz.COLLIDE_NOTIFY flag enabled. Then I define the collide notification function:

Code:
def collideNot(e):
     if e.obj1 == ball or e.obj2 == ball:
         print "collision"
     else:
         print "no collision"
It always shows "no collision". Am I doing something wrong? Thanks in advance.
Reply With Quote