Wrong trigger_response messages when using collision groups with tilemap

pic1
White entity moves and produce this log:

DEBUG:SCRIPT: hash: [trigger_response] enter hash: [trigger_up]
DEBUG:SCRIPT: hash: [trigger_response] exit hash: [trigger_up]
DEBUG:SCRIPT: hash: [trigger_response] enter hash: [trigger_right]
DEBUG:SCRIPT: hash: [trigger_response] exit hash: [trigger_up] <- this is wrong, I think, we are very far from “up” trigger and already exited from it.

Super simple example project attached.
tilemap_coll_groups.zip (41.8 KB)

Hey.
Sorry, dont use a mac to test your files.

Maybe you’ll post your scripts to take a look at?
Screenshots with the colliders?

Hi

You can enable physics debug and see what happend. For enable physics debug call this message
msg.post("@system:", “toggle_physics_debug”). For example in Init function you main script.

When you see collision process may be you understand problem.

function init(self)
	self.direction = -1
	self.speed = 25
	self.position = go.get_position()
end

function update(self, dt)
	self.position.x = self.position.x + (self.speed * self.direction * dt)
	go.set_position(self.position)
end

function on_message(self, message_id, message, sender)
	if message_id == hash("trigger_response") then
		print(message_id, message.enter and "enter" or "exit", message.group)
		
		if message.enter then
			if message.group == hash("trigger_left") then
				self.direction = -1
			elseif message.group == hash("trigger_right") then
				self.direction = 1
			end
		end
	end
end
1 Like

Hey.

Cant get it actually. Maybe some overlapping group-names at the colliders or something?
Did you check the collider settings for GROUP and MASK?

(just to be sure)

The setup is correct. Triggers that uses tilemap as collision shape does not work right.

You try debug physics? What heppend when enable physics debug?