I would like to pin two objects together so when I move either one the other also moves.
So far I have tried simply pinning the two objects to each other. This results in me only being able to move one of the objects.
I have also tried detecting the touch event, unpinning both objects and then pinning the object I haven't touched to the touched one. Under debug this seems to have correctly pinned the objects, but when I move one the other stays still.
I'm sure this is very simple, but I just can't spot how to do it.
Any help welcome.
Develop games in your browser. Powerful, performant & highly capable.
Scratch that worked it out 1 min after this post. I don't know what I was doing wrong before, but this worked :
Detecting the touch event, unpinning both objects and then pinning the object I haven't touched to the touched one.
Still if there is a neater way of doing this then let me know
you can also do it with variables.