When using
glue object to limb <Obj> , <TargetObj> , <TargetLimb> Beware that the positions and rotations of the object being glued are then relative to the object it's glued to. Here's an example using it:
rem glue object example
rem by TheComet
rem setup screen
sync on
sync rate 60
backdrop on
hide mouse
disable escapekey
rem make a sphere object
make object sphere 1 , 10
position object 1 , -30 , 0 , 0
color object 1 , 0xFF00FF00
rem make the spinning box object
make object box 2 , 100 , 5 , 10
color object 2 , 0xFFFF0000
rem main loop
repeat
rem user info
center text 512 , 20 , "Press <Space> to glue/unglue object"
if glue = 0 then center text 512 , 32 , "Object is not glued"
if glue = 1 then center text 512 , 32 , "Object is now glued"
rem rotate the box
zrotate object 2 , wrapvalue(object angle z(2) + 1)
rem glue/unglue
if spacekey()
if flag = 0
flag = 1
rem glue the sphere to limb 0 of the box object
if glue = 0
glue object to limb 1 , 2 , 0
endif
rem unglue the object
if glue = 1
unglue object 1
position object 1 , -30 , 0 , 0
endif
rem change glue value
glue = 1 - glue
endif
else
flag = 0
endif
rem refresh screen
sync
rem end of main loop
until escapekey()
rem clean up
delete object 1
delete object 2
rem end
end
TheComet