- Home /
WASD Movement and rotates with mouse
Hey there, I'm new to Unity and the scripting along with it. My goal is to make my first game. I'm trying to follow many tutorials in hopes to get what i'm looking for by bits and pieces but its not working because I just don't understanding scripting fully (only a little of it).
I'm making a 3D Top Down Shooter, and I want my Player to ALWAYS Move Forward with W, Left with A, Right with D and Back with S. But I want the Player to rotate with the mouse and face towards it. I'm HOPING to have gravity mechanics with the Player as well so i can walk up and down slops or fall off ledges and have very snappy movement. NOT the floaty feeling movement where the character slides.
Can anyone help me find a FULL script or show me how to make my own in detail?
Answer by Harinezumi · Feb 09, 2018 at 11:41 AM
Look into the CharacterController component: https://docs.unity3d.com/Manual/class-CharacterController.html
Also, this tutorial should help (somewhat): https://docs.unity3d.com/Manual/class-CharacterController.html
Just a heads-up note, the default character controller doesn't work when you are looking directly down, because it uses Vector3.Dot() (or Cross()) to determine the forward vector of the character, so you will either have to change that or look slightly not directly down (say, at 89.9 degrees angle).
Your answer
Follow this Question
Related Questions
how to disable player inputs? 1 Answer
Player jitters when moving. 1 Answer
Shooting at mouse position in 2d from a Child Object 0 Answers
Problem with gun/shooting scripting 0 Answers