Ball collisioning with the scene

hi there .i have a problem, i implemented a similar code to helloPhysics. but with diferences.
i proceed to explain my program.
I have a ball that moves around the first person camera, when the mouse is pressed the ball is shooted, then if the ball collide with any object it will return to his original position and then it returns to his original place and continue moves arround the camera, i have attached a terrain the root node.

the problem is, sometime when i press the mouse the ball is not shooted(apparently) and it still rounding the camera, but in reality if it was fired, and this return quickly to his place. this happens because my ball collide with the scene(not the terrain).

i kwnow it beacause i printed the name of the collisioned objects in console.
[java]
if(event.getNodeA()!=null && event.getNodeA().getName().equals(“pelota”)){
ContenedorVariablesGlobales.controladorDeFisica.getControlDeJugador().setPhysicsLocation(new Vector3f(-317.80496f,9.754024f,280.00494f));
ContenedorVariablesGlobales.controladorDeMovimientosJugador.manejarComportamientoDePelota();
System.out.println(event.getNodeB().getName());
}else if(event.getNodeB()!=null && event.getNodeB().getName().equals(“pelota”)){
ContenedorVariablesGlobales.controladorDeFisica.getControlDeJugador().setPhysicsLocation(new Vector3f(-317.80496f,9.754024f,280.00494f));
ContenedorVariablesGlobales.controladorDeMovimientosJugador.manejarComportamientoDePelota();
System.out.println(event.getNodeA().getName());
}[/java]

i dont know why it collide with the scene(visually with nothing).

note: if i dont use a a terrain all work fine.

thanks for any help. and sorry for my bad english.

What are you using as the collision shape for the terrain?

1 Like

iim using a meshCollisionShape generated with CollisionShapeFactory, but my ball is colliding with the sceneNode, it is generated automaticlly when create a terrain with sdk. so the terrain node is attached in the scene node, i know it, because is not printing in console the terrain name.

ajajajajajajajajaja, sorry, sorry, is my fault, is a logic problem, sorry for wate your time, an really thanks for help me.