However, the method does work fine when I make a replica of a tile directly in the scene, which led me to think that both the raycast and the tiles themselves are ok.
(a tile in this case being a sprite containing a staticBody2D, containing a rectangular collision shape)
Also, the collisions between my kinematic2D character and the tiles are working too.
Am I missing something or should I report this as a bug ?
Try with the 2.1.4 beta. Several fixes for physics have been made on that release.
Also make sure you are querying the ray after the engine has got the chance of updating its state; namely, at least a fixed frame has run since it has been created or by calling force_update() (or something similar, check the docs for the exact name) on it before checking.
I just tried with 2.1.4 and ended up with the same results.
The issue is not about the update either : it keeps on returning false when the raycast isn’t modified for multiple seconds, and the test with the replica in the scene does give the right result.
Thank you for your time.
Bastien Creutzer | 2017-07-26 23:04
I think I understand your issue better now. Indeed, it’s weird. Feel free to open an issue. Much better with a minimal example that reproduces the problem.