3 Replies Latest reply on Jul 8, 2013 7:11 AM by James Newton, ACP

    ray cast

    tyree_2 Level 2

      how do you access the models that show up from raycasting. I dont see any documentation on it.

      if member(1).modelsunderray=member(1).model(1) then


      this doesnt work but again I see no documentation covering it

        • 1. Re: ray cast
          James Newton, ACP Level 3

          In the 3D: Controlling action section of Adobe Director Basics, you can visit the section on Rays. On the Rays page, click on the right arrow to see four additional articles, including a short tutorial and a demo movie.

          • 2. Re: ray cast
            tyree_2 Level 2

            that doesnt say how to access the models being hit by the ray. after the hit has taken place. only how to display them in the message window 

            • 3. Re: ray cast
              James Newton, ACP Level 3

              Umm... I think that you will find that it says a lot more than how to display them in the message window.


              I am, of course, assuming that you know how to download the demo movies so that you can study them. For example, you can execute the following line in the Message window:


              go movie "http://www.adobe.com/support/director/examples/AirHockey.dir"


              This will open the demo movie for you on the Stage in Director, and you will be able to study all the scripts. In particular, you will find this handler:



              on GetImpactData(aMember, aPosition, aDirection, aBarrier)


                vRayInfo                     = [:]

                vRayInfo[#maxNumberOfModels] = 1

                vRayInfo[#levelOfDetail]     = #detailed

                vRayInfo[#modelList]         = [aBarrier]


                vRayData = aMember.modelsUnderRay(aPosition, aDirection, vRayInfo)

                vImpactData = vRayData.getLast() -- VOID if no barrier detected


                return vImpactData

              end GetImpactData


              I am also assuming that you know how to experiment and explore, and extrapolate from the examples that you can find to create code that fits the custom specifications of your own project.