Daabbcc collision issue

@roccosaienz If you tag me here on the forum, open an issue, or post a question in the discussions section on GitHub, I might be able to reply sooner since I get notifications.

It seems a bit tricky to reproduce this. I’d appreciate it if you could share a minimal repo case when you encounter the issue. It will save both of us some time.

I tried to reproduce this (as far as I understood) but couldn’t catch the issue:

  • Blue is moving on Y-axis
  • When it collides with pink, I set its size to 5x5. Since it gets smaller (and is no longer colliding), it will continue to move on the Y-axis and collide again.

code:

local group_id = daabbcc.new_group(daabbcc.UPDATE_FULLREBUILD)
local aabb1_id, aabb2_id
local y = 55

function init(self)
	aabb1_id = daabbcc.insert_gameobject(group_id, "/pink", 50, 20) -- static pink
	aabb2_id = daabbcc.insert_gameobject(group_id, "/blue", 50, 20) -- Moving blue rect
end

function update(self, dt)
	local result, count = daabbcc.query_id(group_id, aabb2_id)

	if result then
		print("Collision occurred - Set Size")
		daabbcc.update_gameobject_size(group_id, aabb2_id, 5, 5)

		-- Since it gets smaller, it will continue to move on the Y-axis and collide again
		go.set("/blue#sprite", "size", vmath.vector3(5, 5, 0))
		sprite.play_flipbook("/blue#sprite", hash("red"))
	else
		y = y - 0.1
		go.set_position(vmath.vector3(0, y, 0), "/blue") -- move blue
	end
end


4 Likes