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!
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better đź’—
Register LoginAdvertisement