Defold 1.2.156 has been released

We will update this in the built-in shaders for the next release.

2 Likes

Solved in 1.2.159

2 Likes

Is there any plan for Editor support for creating joints already? :slight_smile:
Or at least it would be great to see a tutorial or an example! I was following the api, but can’t get any effect like e.g. @Pkeod shown above :confused:

I have such fragment:

    elseif action_id == click and action.pressed then
		print("JOINT:")
		physics.create_joint(physics.JOINT_TYPE_FIXED,
			"#collisionobject", "hero_joint", vmath.vector3(0),
			"/joint#collisionobject", vmath.vector3(0))
		timer.delay(2, false, function()
			physics.destroy_joint("#collisionobject", "hero_joint")
		end)
	end

No errors, only a printed “JOINT:” ofc. :confused:

1 Like

Here is the joint creation code from one of the examples above

physics.create_joint(physics.JOINT_TYPE_SPRING, "/hero#collisionobject", "string", vmath.vector3(0), "/target#collisionobject", vmath.vector3(0), {length = 60, frequency = 0.3, damping = 0.2})
2 Likes

Thanks! And it also turned out I wasn’t using dynamic type of collision object, so that’s why I didn’t saw any changes :confused:

3 Likes

You can see the joints when showing debug physics.

2 Likes

Hi! Sorry for bringing up an old topic here. But I can’t figure out how you did this. what collision types are you using?
I’d basically like to make a tentacle which swings around underwater, if that helps.

edit: Okay, i have the thing now! I have tentacle swinging around all over the place.

3 Likes

Okay, I don’t understand it again.

This is a physics.JOINT_TYPE_FIXED with a max length of 10, but it’s stretching out (which I would have expected from a spring joint). I had to set the mass of the lower object very high and also set gravity to 99999 just to get it to hang normally without floating up, but I don’t want it to stretch the joint. Any help?

Joint must be fixed length and the lower of the two collision objects should be affected by gravity.

1 Like

What’s your physics scale? Try setting it to be lower.

Edit: I read that wrong. Can you upload the project as a zip?

Pkeod, you fixed it despite what your conscious brain was telling you about how to read it. :exploding_head:

i think i need to play with physics scale and a few other setting to get this perfect. Thanks!

2 Likes

For fixed joints, make sure you are also setting the max_length in the properties.

2 Likes