Collision Detection - completly new!

Hiya,

I have only been doing JMonkey for about a week now and have managed to created a track with a wall at the end. I have been able to set the camera height but am now completly stuck on how to prevent the user from just walking through the wall. I have tried reading many of the other quetsions on this topic but have found they are really confusing. I would start them and then get stuck.

Any suggestions on how to start this would be grateful! :slight_smile:



My plan for this process is currently:

  1. Check if a collision has been detected - store this in an array
  2. If this array is not null - i.e collision has been detected then load last known position.



    So far i have tried to always store the position of the camera in an array of vectors called currentPositions[].

    I tried to see if a collision had been made with a Box box; by using:

                for(int a =0; a<x; a++){

                          box.getCollisionData(a).toString();

    Here i then check to see if the String is null. If it isnt then i want to move the camera back away from the wall by loading the last know position. Or even just get the collision to be seen and printing "Collision".



    Any help is much appreciated!

    Thanks in advance,

Collisions are covered in the Flag Rush tutorials, more specifically this one. Play with this and see if it helps you solve your problem.

Thanks, i wil have a look at that :slight_smile: