sketchucation logo sketchucation
    • Login
    🤑 SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

    Connect & disconnect joint function?

    Scheduled Pinned Locked Moved SketchyPhysics
    3 Posts 2 Posters 1.1k Views
    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