[Resolved] isFixedRotation changing other physics properties ?

Hi,

I’m having a trouble with isFixedRotation

it seem to affect somethings other than the rotation,
here is a sample of code that illustrate the problem :

[lua]local physics = require(“physics”)

physics.start()
physics.pause()

local rect = display.newRect(100, 30, 30 ,30)
physics.addBody(rect,“kinematic”, {shape, -15, -15, 15, -15, 15, 15, -15, 15})
local joinedRect = display.newRect(100, 30, 30 ,30)
physics.addBody(joinedRect,“dynamic”, {shape, -15, -15, 15, -15, 15, 15, -15, 15})
physics.newJoint( “weld”, rect, joinedRect, rect.x, rect.y )
–joinedRect.isFixedRotation = true

physics.setDrawMode(“debug”)
physics.start()[/lua]

uncommenting the line “joinedRect.isFixedRotation = true” [line 11]
will make the dynamic body fall whereas if the dynamic body is not rotation fixed, it will stay in place(behind the kinematic body), I would like the keep the dynamic body behind the kinematic body, but with fixed rotation, any ideas ?

[import]uid: 79037 topic_id: 28936 reply_id: 328936[/import]

I finally found a solution (work around)
Using a pivot joint instead of a weild joint with rotation limit on the joint and isFixedRotation fixed everything

[import]uid: 79037 topic_id: 28936 reply_id: 116665[/import]

Hey Darune - thanks so much for updating with your solution, it may very well help others :slight_smile: [import]uid: 52491 topic_id: 28936 reply_id: 116707[/import]

I beleive that there might be a problem for people needing a weld joint, witch in my case in not necessary [import]uid: 79037 topic_id: 28936 reply_id: 116708[/import]