creating a simple joint, objects can't overlap?

Oddly enough I can’t seem to get this to work: a simple link between two physics objects bouncing around. I have read the API page on joints, checked the bridge code, I must be either very blind or tired? anyway here go’s

code snippet:

...  
local belly = display.newCircle(100, 0, 50)  
belly:setFillColor(0, 255, 0)  
local head = display.newCircle(100, 0, 20)  
gead:setFillColor(0, 50, 0)  
  
physics.addBody(belly, "dynamic", { density=3.0, friction=0.5, bounce=0.3 })  
physics.addBody(head, "dynamic", {density=3.0, friction=0.5, bounce=0.3})  
  
local group = display.newGroup()  
group:insert(pandaHead)  
  
physics.newJoint("pivot", head, body, 100, 0)  

I would expect this code to show one small circle attached inside a larger circle. Instead, the two shapes always spawn on top (or next) of each other without any overlap. My first guess was they have to be in separate layers, but this doesn’t solve the problem either.
What am I overlooking?
Thanks in advance :slight_smile:
[import]uid: 44968 topic_id: 7989 reply_id: 307989[/import]

no clue as to why this didn’t work, but starting from scratch and pretty much writing the same code now works
ahh well. [import]uid: 44968 topic_id: 7989 reply_id: 28483[/import]

You mixed up some variable names: e.g. “body” / “belly”, “head” / “pandahead”

Or some typos like “gead”
I recommend to watch the output in the terminal window, it helps to find the problems! [import]uid: 42078 topic_id: 7989 reply_id: 28492[/import]