I’m at my wits end on this. I want to delete the bottom poly tile (the one already placed) if it’s covered up with another tile. If there is a rock or tree there it will delete the dropped tile. the tree/rock code works perfectly. The issue is with the triggers on the poly tile overlapping a poly tile.
I have a trigger setup and track when it enters. It appears to always work in trigger message.enter. But what appears to be off is the trigger message.enter == false. Sometimes it works and other times it doesn’t work. Here’s 2 videos to show you how it works sometimes and sometimes it doesn’t.
almost working:
And here it is broken.
In the videos you can see my print statements showing how I’m tracking where it is at.
I know my if can be cleaned up to one line (like the two at the start, but I want to try and pinpoint the issue.
To me it’s not registering the “exit” event consistently.
if message_id == hash("trigger_response") then
if message.own_group == hash("top_tile") and message.other_group == hash("tile") and message.enter then
self.delete_me = true
elseif message.own_group == hash("top_tile") and message.other_group == hash("tile") and message.enter == false then
self.delete_me = false
elseif message.enter then
if message.own_group == hash("top_tile") and message.other_group == hash("bottom_tile") and self.dragging then
print("I will delete this tile: " , message.other_id)
self.delete_other_id = message.other_id
self.delete_me = false
self.delete_other = true
end
elseif message.enter == false then
print("---------------------message enter is false...leaving trigger---------------------")
if message.own_group == hash("top_tile") and message.other_group == hash("bottom_tile") and self.dragging then
print("+++++++++++++++++++Now I passed the next IF after existing trigger++++++++++++++++")
print("*********I will NOT delete this tile:******** " , message.other_id)
self.delete_me = false
self.delete_other_id = nil
self.delete_other = false
end
end
end