I’m generating some procedural meshes based on a collision layer in my tilemap. The mesh seems to be generated correctly (as far as I can tell), but my raycasts won’t hit it. If I attach a ‘collisionstart’ event to the player object, it definitely hits the mesh. Its just the raycast that’s failing.
The relevant raycast code is in scripts/player.js and the mesh is being generated in scripts/LDtk.js in the parseCollisionLayer anonymous function.
There’s definitely something weird going on, I tried manually casting a ray from a high z to a low z value directly “through” the mesh and its still not hitting. I may just have to bite the bullet and use a 3D camera controller script to view the mesh from all sides once its been generated.
Switching to p2 is giving me much better results! I still need to tinker with some things to get it all working properly, but I think that may be the solution for me. Thanks for suggesting that, it didn’t even occur to me to just use a non-3D library…