I has a problem with Ray and Terrain. I following a video online (https://www.youtube.com/watch?v=sfNRZ_BYT5o) to create a terrain for my game. I need the collision to move my character to. But it turns out that, the ray (I created the ray same as the book’s example) does not collide with the terrain. As I understand, my terrain does has any geometries so there is nothing for the ray to collides with. When I loadModel() the terrain, It should be the a Spatial or a Node (with no Geom child). Thus, I am figuring out how to detect the collision. Is the ray only collide with geometry??
I hope there is a solution for this, I found some same issues but I cannot applied them on my case because I create a terrain from Jmonkey editor but not writing code.
P/S: I just think about a solution that I put my terrain on a big invisible box and detect the collision with the box instead of the terrain. but not sure that the invisible box is invisible with the ray. I will try it now but I hope there is a official solution for this case.