|
Hi all, I am making a third person hack and slash game for university and i am having difficulty with scripting the movement. I have a player look at script and a player move script. I want the game to play similarly to spiral knights in the way that the player can rotate with the mouse and move up down left right NOT on a grid. However I get the problem where the player orientation makes the 'wasd' controls relative to where the player is. I want the move direction to be always up down left right NOT relative to the player. Here is my look at script: Here is my Movement script: I have used the third person unity tutorial script for the movement but it only works for a short while after putting the script onto my player. It soon makes the player glitch as the scripts I assume are conflicting. The player is orientated towards the mouse yet the move script is making it turn on the 'wasd' inputs. If someone could look at these scripts and see how to allow the player to move up down left right. My camera does not rotate, but it follows the player just like spiral knights. I need the character to move up down left right not relative to where it is facing from the mouse look script. If anyone could have a look at this I would be truly grateful, thanks for your time.
(comments are locked)
|
|
The movement is relative to the player orientation because you transform the original direction vector with TransformDirection: Just comment out this line and the player will move following world axis (even when rotated to other directions, which may be somewhat weird) Thank you very much aldonaletto
Feb 11 '12 at 03:55 PM
reto
(comments are locked)
|
