How can I get a rotated plane object to move along the default terrain (move in the x-z plane) using WASD? The plane is perpendicular to the terrain.
I did the following steps below, and I am getting really screwy behavior when trying to move the plane. Once I make a simple modification to the stock FPSController (see bottom), the plane object will only move in the -z direction (via the S key) once I press and hold A or D. Even weirder, W does not move the plane in the +z direction if I hold A or D. Pressing W or S by themselves does nothing.
I did the following (and nothing else, starting from scratch) to get that far:
From here, I changed one line in FPSInputController.js to change the W/S keys from up/down(y) to in/out(z), as my plane is rotated to be perpendicular to the terrain:
At first, I worried that I was trying to do the impossible, but the plane does actually move in -z if you also get it moving in the x direction, so you'd think generic movement in Z would be possible for the plane. Is there another method to accomplishing this?
asked Apr 03 '11 at 10:22 PM
Making a cube instead of a plane and adding the standard controllers without modifying the scripts seems to work. Shrinking one of the cube dimensions to near zero gets the same effect done and allows for WASD movement along the terrain.
I suppose the plane doesn't work because it only exists in 2 dimensions, and I needed it to move in the 3rd dimension.
While this cube solution has its texture show up on two sides instead of one for the plane, I can work around that by masking with multiple cubes.
answered Apr 04 '11 at 06:22 PM