sketchucation logo sketchucation
    • Login
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info

    OnTouch, OffTouch

    Scheduled Pinned Locked Moved SketchyPhysics
    3 Posts 3 Posters 894 Views 3 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • N Offline
      NorviewsVeteran
      last edited by

      How do you script something so that when its touching, var=1, and when it stops touching, var=0?

      I've done it before, but when I tried it again, it didn't work. Even reverse engineering the one that did work, didn't work. I'm very confused at this point and scripting has stumped me again.

      This is what worked:

      in OnTouch;
      setVar("left_easy",1)
      
      in OnTick;
      setVar("left_easy",0)
      

      and what didn't work:

      in OnTouch;
      setVar("thrust",1)
      
      in OnTick;
      setVar("thrust",0)
      

      ```
      //This_Is_All(I)+=Know()About.Code;
      ```

      1 Reply Last reply Reply Quote 0
      • P Offline
        phy
        last edited by

        Try putting a getSetVar('thrust',0) where you would put a getVar('thrust').

        Tableau de comparaison de Staxyn s'agit d'un mГ©dicament uniquement sur ordonnance.

        1 Reply Last reply Reply Quote 0
        • M Offline
          MrDailyBlah
          last edited by

          in the "scripted" section of the UI
          , type:
          ontouch{ setVar("blahblahblah",1) } onuntouch{ setVar("blahblahblah",0) #this is the "offtouch" bit }
          try that..

          1 Reply Last reply Reply Quote 0
          • 1 / 1
          • First post
            Last post
          Buy SketchPlus
          Buy SUbD
          Buy WrapR
          Buy eBook
          Buy Modelur
          Buy Vertex Tools
          Buy SketchCuisine
          Buy FormFonts

          Advertisement