Contact point response not working between versions (Solved)

I am currently re-coding my player character, I’ve gotten to the collision message, but I haven’t been able to trigger contact point response, which is weird because I have changed very little in the message.

this is the working code from my old version:

function on_message(self, message_id, message, sender)
	-- check if we received a contact point message
	if message_id == msg_contact_point_response then
		-- check that the object is something we consider an obstacle
		if message.group == Ground then
			handle_obstacle_contact(self, message.normal, message.distance)
		end
    end    
end

and this is the new version which doesn’t work

function on_message(self, message_id, message, sender)
	--Collision detection----------------------------------------------------
	if message_id == msg_contact_point_response then
		if message.group == Ground then
			print("read")
			handle_obstacle_contact(self, message.normal, message.distance)
		end
    end
end

I can assure you, nothing else has changed, even ‘Ground’ is just local Ground = hash("Ground") in both versions

I’ve checked with print statements, it is has issues with getting past
if message_id == msg_contact_point_response then
in the later version

help!

Hi there,
apart from the comments, this code is identical, so sth must have happened elsewhere.
My guess is that you might have removed the pre-hashed string by accident:

local msg_contact_point_response = hash("contact_point_response")
5 Likes

that was it, thank you

1 Like