1 Reply Latest reply on Sep 8, 2006 11:50 AM by tedalde2

    Collision of two objects goto frame or marker.


      Here is the scenario.
      A W3D file with two objects loaded into director MX.
      Object 1 is a child of the default camera and moves with the camera.
      Object 2 is a moving object that moves.
      The problem is to resolve a collision between the two objects.
      When object 1 collides with object 2 have the play head go to a frame or marker.
      How the code would be written to accomplish this.

        • 1. Re: Collision of two objects goto frame or marker.
          tedalde2 Level 2
          You can use the collision modifier on the two models. It gets a little complicated, so you should check out the HELP. I haven't used it often, but the basic procedure is to yourmodel.addmodifier(#collision) to both your models, yourscene.registerForEvent(#collideAny, <handlername>, <script object>, <optional params>) so you can get the collision event when it happens, and then simply _movie.go("somemarker") when the event occurs. You should set the yourmodel.collision properties appropriately, probably #enabled = TRUE, #resolve = FALSE, #immovable = FALSE and #mode = #box.