Hey all! I’m working with raycast and got a issue that my raycast is not colliding with my mesh. The mesh I’m trying to collide is a imported .babylon file and the raycast simply don’t collide with it.
I tested with a simple box and then the collide worked, just not sure what should I do to debug it and make the raycast to work, does anyone has any ideas of how to fix that?
But why thi is needed in my case @sebavan? I mean is it something that I messed up with my mesh?
I wanted to know what happened if possible cause I saw a lot of situations that the mesh don’t needed that computeWorldMatrix and wanted to understand why its needed in my case
It is not smthg you messed up it is just that after loading there are a few operations that happens during the render which did not happen yet so you need to call it manually.
Now I’m curious, add the raycast on the a beforeRenderObservable worked!
But the fact is that on my project its not working even creating the ray on the beforeRenderObservable, does that computeWorldMatrix happens on each render observable?
On my project here it don’t work even with the computeWorldMatrix
Would be great to repro in the playground, we can not clone/run all the projects locally unfortunately. We usually do it in case of build failure. Even more as your project is pretty big already.
Could you add in the playground the missing part that would make it fail ? so that we can find a fix
Its pretty big code as you said, but the place where I add the Ray is on the Physics class on the applyPhysics method.
Just a little explanation of whats going on, the whole point about that Physics is that its a property of the Prefab abstract class that each of my “prefabs” implements, so basically both the Ground and Player has the physics that use that raycast, the issue is on the PlayerRay that’s not hitting the Ground mesh. Also on that applyPhysics method I added that computeWorldMatrix but the behavior is the same