sketchucation logo sketchucation
    • Login
    Oops, your profile's looking a bit empty! To help us tailor your experience, please fill in key details like your SketchUp version, skill level, operating system, and more. Update and save your info on your profile page today!
    🛣️ Road Profile Builder | Generate roads, curbs and pavements easily Download

    Connect & disconnect joint function?

    Scheduled Pinned Locked Moved SketchyPhysics
    3 Posts 2 Posters 1.2k Views 2 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.
    • H Offline
      hpnisse
      last edited by

      Hello!
      I got a few problems with scripted-joints in sketchyphysics.
      I've got the function that connect two objects to work, but not disconnect.


      This is the script that I use to connect two objects, and it work really good!

      
      ontouch{|toucher,s,p|
         if key("W")==1
                  connect(toucher,"fixed")
         end
      }
      

      But when I want to disconnect two objects thats connected with the script, it dosn't work.
      I know that there is a function that should do this, disconnect() here is the link, But I can't get it to work!
      So how should I do to create a disconnect script that can be trigger by a key or getVar command like the connect script?
      Thanks!

      ` /hpnisse`
      ` Windows 7 U -Sketchup 8 -SketchyPhysics 3.2-Dec2 - from Sweden`

      1 Reply Last reply Reply Quote 0
      • C Offline
        CPhillips
        last edited by

        ontouch{|toucher,s,p|
           if key("W")==1
                    @joint=connect(toucher,"fixed")
           end
        }
        #Then later.
        if(@joint!=nil)
           @joint.disconnect()
        end
        
        
        
        
        1 Reply Last reply Reply Quote 0
        • H Offline
          hpnisse
          last edited by

          Thanks so much! I've got it to work with that script!

          ` /hpnisse`
          ` Windows 7 U -Sketchup 8 -SketchyPhysics 3.2-Dec2 - from Sweden`

          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