Hopefully you've fixed this already, but I've had a look and I'm getting the same problem with get_facing_entity just returning the same entity each time.
I'm just a beginner with Solarus but it definitely looks like a bug?
However, when my custom entity collides with a chest, my function isn't triggering, only jumpers - so that might be a problem with part of your code that isn't shown.
You might want to post the problem with get_facing_entity on the gitlab as an Issue, I don't expect that to happen.
Anyway, I've found a workaround that will hopefully do what you want:
Change the line:
to
self will be the custom_entity, and object will be the same as your object variable - you won't need to assign it, just delete the 'object = get_facing_entity()' line.
I worked this out from reading the docs on set_can_traverse, it mentions that the function you assign can take 2 parameters, the entity and the one you're colliding with.
Hopefully that helps if you haven't already fixed it.
I'm just a beginner with Solarus but it definitely looks like a bug?
However, when my custom entity collides with a chest, my function isn't triggering, only jumpers - so that might be a problem with part of your code that isn't shown.
You might want to post the problem with get_facing_entity on the gitlab as an Issue, I don't expect that to happen.
Anyway, I've found a workaround that will hopefully do what you want:
Change the line:
Code Select
function jumper_found():
to
Code Select
function jumper_found(self, object):
self will be the custom_entity, and object will be the same as your object variable - you won't need to assign it, just delete the 'object = get_facing_entity()' line.
I worked this out from reading the docs on set_can_traverse, it mentions that the function you assign can take 2 parameters, the entity and the one you're colliding with.
Hopefully that helps if you haven't already fixed it.