Vector3 fwd = highlighted.transform.TransformDirection(Vector3.forward); How do you change this if you camera angle changes also. How do I make forward follow the camera?
at the moment Im using back for the angle Im on. I want to calculate which angle my camera is so I can move something towards it. What is it towards camera?
Camera forward you can just use camera.transform.forward From object to camera is camera.transform.position - object.transform.position (then normalize if needed)
I would like to calculate the direction to the camera and the direction away from camera. Vector3 fwd = highlighted.transform.TransformDirection(camera.transform.position); This can work to get towards camera but what is wrong with camera.transform.back?
Time for a picture. I have no idea what you are talking about. As a general rule vector math always starts with a picture. I keep a pad right next to my computer for just that reason.
Ok imagine you got 4 objects infront of you. You select the one in the middle and then you use your left arrow key to move the highlighted selected object to highlight the object left of the selected object with Vector3.left Now imagine I fly around to the other side of the screen and look at objects on the other side of it. How do I automatically adjust Vector3.left to go left instead of right? What is the routine here? You created Vector up,left,down,forward and all that but it is not tied to the camera or is it?
I got a 3d puzzle that Im trying to switch peices with arrow keys but it works on default camera view. I dunno what todo with vector3.down and left and that when I switch to the other sides. Default view is ok. You can go vector3.left and it goes left but on the other side it goes right.