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?
-
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 akeyorgetVarcommand like the connect script?
Thanks! -
ontouch{|toucher,s,p| if key("W")==1 @joint=connect(toucher,"fixed") end } #Then later. if(@joint!=nil) @joint.disconnect() end -
Thanks so much! I've got it to work with that script!
Advertisement