Hi, I have got a basic controller working for rolling a ball.
I now wanted to control the ball to move in the direction the camera is facing
Here is the working code so far I got,
https://playground.babylonjs.com/indexStable.html#RGV550#2
I got the direction the camera is facing with the help of the below line of code.
But I dont know how to apply it to the Direction vector before using it to move the player.
camera.direction = camera.getFrontPosition(1).subtract(camera.position).normalize();
I tried multiplying it with the direction vector, adding it with the direction vector also multiplying by a scalar value. Nothing seems to work. Maybe I am just weak in maths