Hello Good people!
I would like to present a problem I have been trying to solve.
I have a 3rd Person game where the character needs to interact with the objects. Currently, I am shooting rays from the camera direction (the only way i know)
So now i need help trying to shooting the ray from the head of the character to in the direction directly infront of the character.
This is a spinet:
Ray ray = new Ray(cam.getLocation(), cam.getDirection());
System.out.println(cam.getLocation().toString());
System.out.println(cam.getDirection().toString());
CollisionResults results = new CollisionResults();
objects.collideWith(ray, results);
for(int i = 0; i < results.size(); i++){
System.out.println(results.getCollision(i).getGeometry().getName());
if(results.getCollision(i).getGeometry().getName().startsWith("ID")){
Please help me with this. Thanks a load!