Defold 1.2.156 has been released

Oh, I’ll make sure to update! Thanks!

3 Likes

First version: https://www.defold.com/manuals/physics/#_joints

5 Likes

I’m glad you guys decided to skip the editor support for joints so we get to use them sooner!

Btw I have also been using physics.set_gravity() since the day 1.2.155 released. Even though I’m not doing anything cool with it, it’s really nice to be able to set it from code, rather than editing the game.project file.

3 Likes

Why haven’t we solved this old problem yet? :face_with_thermometer:

1 Like

This is next on our list of improvements to physics. But it is dependent on another engine change where we need to make it cheaper to know when a transform hierarchy has changed. We really don’t want to poll for scale changes every frame but rather have a system where we have some kind of dirty flag or similar.

5 Likes

I’m very happy to read this. On what sprint do you plan to do it?

1 Like

It has not been decided yet. We plan one sprint at a time. What I can say is that the issue has a high priority in the backlog.

6 Likes

I think precision for the view_proj should be changed to highp too.

3 Likes

You need to set highp for view_proj as well… On the Galaxy S10e sprites begin to shake at distances greater than 16384px.

2 Likes

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