4 Replies Latest reply on Apr 5, 2007 8:50 AM by Nickname_is_none

    Pause 3D camera movement

    Nickname_is_none Level 1
      I have a 3D scene that uses interactive and default movement of the camera (press a button to move the camera, release the button and the camera moves back to it's origin).

      I want to create a button to act as a pause button so any camera movement stops but then resumes when the button is pressed again.

      Hopefully there's some easy lingo, but I seem to be missing it. Am I right in thinking that I need to first check that the movie is playing then pause/play it??

      eg (bit rough)
      put member ("Camera"). playing
      if true member("Camera").pause
      if not then member("Camera").play
        • 1. Re: Pause 3D camera movement
          Level 7
          Hello there :)

          You could have a button that toggles a global eg. gPaused between true and
          false with each click and add an if statement to your camera lingo like this
          pseudo code...

          ---------------Possible Button behavior-----
          global gPaused

          on beginSprite
          gPaused = -1
          end beginSprite

          on mouseUp me
          --toggle the pause on / off
          gPaused = -gPaused
          end mouseUp



          ------------------------------3D sprite behaviour snippet
          on exitFrame
          if NOT gPaused then

          --Put all your camera lingo inside this if statement
          if NOT gPanLeft AND NOT gPanRight AND NOT gPanUp AND NOT gPanDown AND NOT
          gZoomIn AND NOT gZoomOut then
          pCamRotX = pCamRotX * 0.95
          pCamRotY = pCamRotY * 0.95
          pCamRotZ = pCamRotZ * 0.95
          pCamera.transform.rotation = vector(pCamRotX,pCamRotY,pCamRotZ)
          end if

          end if
          end exitFrame
          -------------------------------

          Cheers

          Richard Smith


          • 2. Re: Pause 3D camera movement
            Nickname_is_none Level 1
            Now nothing moves!!! :(

            I've triple checked the spellings. I can get the movement, but not the pause, if I delete the NOT from the first line in the camera lingo. Varying the text in the button behaviour does not effect anything.

            Any clues?
            • 3. Re: Pause 3D camera movement
              Level 7

              > Any clues?

              Hi there, sorry, my fault, I assumed -1 was classed as false in Director,
              try this....


              ------------------------------3D sprite behaviour snippet
              on exitFrame
              if gPaused = -1 then

              --Put all your camera lingo inside this if statement
              if NOT gPanLeft AND NOT gPanRight AND NOT gPanUp AND NOT gPanDown AND NOT
              gZoomIn AND NOT gZoomOut then
              pCamRotX = pCamRotX * 0.95
              pCamRotY = pCamRotY * 0.95
              pCamRotZ = pCamRotZ * 0.95
              pCamera.transform.rotation = vector(pCamRotX,pCamRotY,pCamRotZ)
              end if

              end if
              end exitFrame
              -------------------------------

              Remember to add all your camera rotate and return to center code inside the
              if gPaused = -1 statement.

              Hope this works! Cheers :)

              Richard




              • 4. Re: Pause 3D camera movement
                Nickname_is_none Level 1
                Thanks for your help Richard, much appreciated.