The Hacktoberfest - an event where you can contribute to any open source or available for PRs project and get awesome rewards! - is coming and I would like to here from you, if you are planning any contributions and if so, it would be great to share them here when they are out!
I’d also love to see the community contribute more examples for the Examples section of the Learn page. It would be really cool to have examples of more or less all of the Defold API functions.
Agreed! I think I have t-shirts from the last three or four years!
It actually does work. Here’s from the example I shared earlier on Discord:
local FRONTWHEEL = "frontwheel#collisionobject"
local BACKWHEEL = "backwheel#collisionobject"
local BODY = "body#collisionobject"
local FRONT_ID = hash("frontwheel")
local BACK_ID = hash("backwheel")
local V3ZERO = vmath.vector3(0)
function init(self)
local props = {
motor_speed = 20,
enable_limit = false,
enable_motor = true,
max_motor_torque = 100,
}
physics.create_joint(physics.JOINT_TYPE_HINGE, FRONTWHEEL, FRONT_ID, V3ZERO, BODY, vmath.vector3(40, -10, 0), props)
physics.create_joint(physics.JOINT_TYPE_HINGE, BACKWHEEL, BACK_ID, V3ZERO, BODY, vmath.vector3(-40, -10, 0), props)
timer.delay(2, false, function()
local props = {
motor_speed = -20,
enable_limit = false,
enable_motor = true,
max_motor_torque = 100,
}
physics.set_joint_properties(FRONTWHEEL, FRONT_ID, props)
physics.set_joint_properties(BACKWHEEL, BACK_ID, props)
end)
end
The problem was that I had the motor torque set too low and the initial speed too high. With a higher torque the direction of movement changes as expected.
As a second task for this Hacktoberfest I continue translating Defold manuals, this time message passing (though it is still not visible on the Defold website)
@Pawel Inspired by this post and your great Joint Physics example, I decided to give it a go and submitted an example on panning sound. Now the example is up on the site. cheers~