I have a script that lets me drag a kinematic shape, and on action.released
it gets switched out by the same shape but with a dynamic collision type.
Code
function init(self)
msg.post(".", "acquire_input_focus")
end
function on_input(self, action_id, action)
if action_id == hash("leftclick") then
if action.pressed then
newObject = factory.create( "#cube_kinematic", vmath.vector3(action.x, action.y, 0), nil, nil, vmath.vector3(0.5, 0.5, 1))
end
go.set_position(vmath.vector3(action.x, action.y, 0), newObject)
if action.released then -- Here is the object being switched out
go.delete(newObject, true)
newObject = factory.create( "#cube", vmath.vector3(action.x, action.y, 0), nil, nil, vmath.vector3(0.5, 0.5, 1))
end
end
end
I don’t understand why a collision is happening here?