So, um…
I have written some code for detecting collision (because I don’t want to use the other collision system, I have things planned for not using that), however, the triggers are not working…? I have code here if anyone wants to look at it:
if message_id == hash("trigger_response") then
if message.other_group == hash("wall") then
if message.enter then
if message.own_group == hash("up") then
wall_up = true
print("wall_up")
end
if message.own_group == hash("left") then
wall_left = true
print("wall_left")
end
if message.own_group == hash("right") then
wall_right = true
print("wall_right")
end
if message.own_group == hash("down") then
wall_down = true
print("wall_down")
end
else
if message.own_group == hash("up") then
wall_up = false
print("wall_up_leave")
end
if message.own_group == hash("left") then
wall_left = false
print("wall_left_leave")
end
if message.own_group == hash("right") then
wall_right = false
print("wall_right_leave")
end
if message.own_group == hash("down") then
wall_down = false
print("wall_down_leave")
end
end
end
end
Hope you can fix this quickly. Setting up the groups and masks and types etc. is a little complicated at first but once you’ve got it right it will be great. your code looks good to me, although I am not an expert so my advice would be that you look into how the collision objects are set up.
Yes, the script is connected to the correct game object (the game object receives input in the form of a message and I tested your method), however, I’m still not receiving a trigger response.
I tried putting a print message in the on_message() function and within the trigger_response, it turns out that I’m not getting anything from the trigger_response.