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 akey
orgetVar
command 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