Simple Collision Example

Software: Away3D 4.x

Manuel L., Member
Posted: 13 December 2012 08:19 AM   Total Posts: 99

Hey, i tried understanding awayphysics, but it seems not to be that easy ^^
could someone give me some simple example code for a collision detection between two objects?

If “ObjectA” collides “ObjectB”, trace(“collision”);

would be awesome!

   

Avatar
loth, Sr. Member
Posted: 17 December 2012 11:26 PM   Total Posts: 236   [ # 1 ]

look
https://github.com/away3d/awayphysics-examples-fp11/blob/master/src/CollisionEventTest.as

and

https://github.com/away3d/awayphysics-examples-fp11/blob/master/src/CollisionFilterTest.as

collsionGround and collsionBox is juste a number to dispatch change or connect collision make some try is not so complex

   

dr_slam, Newbie
Posted: 08 January 2014 08:31 AM   Total Posts: 4   [ # 2 ]

Hi, here is my code:

if (object_1.worldBounds.overlaps(object_2.worldBounds))
 
  {
  trace(‘crash!!!’);
 
  }

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X