The input class could really benefit from using properties instead of field accessors Look into floating point comparison, 0.0 = myVar should never be used due to floating point precision These are really fast when checking enum values, or at least use an else if statement since it can never be in 2 states at once Use switch statements for checking the player state. Look at using inlined variables for a few things such as your RaycastHit declarations I have a couple suggestions from looking at the code base. Rb.position += movement * moveSpeed * Time.Cool controller, I haven’t extensively checked it out just yet. Vector3 movement = new Vector3(hAxis, 0f, vAxis) Using the Awake function to set the referencesįloat hAxis = Input.GetAxis("Horizontal") float moveSpeed = 6f // Player's speed when walking.įloat jumpHeight = 10f // How high Player jumps If there's even a tutorial that break it down to really understand, that would be great or just some code with comments (I have a C# background). So, I want to move my character just like in Splinter Cell Blacklist, and to have the camera with the crosshair controlled by the mouse (if I shoot, the character would rotate if not facing the target and then shoot).įor the movement, if it is not possible with the rigidbody then I'll use one of the others, it's just that I love the real feeling that the rigidbody has. I have had about 30 web pages opened since a week browsing topics about it but I haven't found anything (almost made me feel like I am trying to do something impossible lol.). It's been now more than a week that I've tried again and again to get my character moving using a rigidbody component and NOT the Character Controller or the simple transform.Translate. I am new to Unity trying to make my first game (a Third Person Shooter).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |