UpdateStrafeMovement
How do I use Update Strafe Movement
Below are practical examples compiled from projects for learning and reference purposes
Featured Snippets
Line | Code | Ex.. |
---|---|---|
40 | UpdateStrafeMovement(); | 1 |
122 | void UpdateStrafeMovement() | 2 |
File name: RPGMovement.cs
Copy
30 void Update()
31 {
32 if( m_PhotonView.isMine == true )
33 {
34 ResetSpeedValues();
35
36 UpdateRotateMovement();
37
38 UpdateForwardMovement();
39 UpdateBackwardMovement();
40 UpdateStrafeMovement();
41
42 MoveCharacterController();
43 ApplyGravityToCharacterController();
44
45 ApplySynchronizedValues();
46 }
47
48 UpdateAnimation();
49 }
File name: RPGMovement.cs
Copy
122 void UpdateStrafeMovement()
123 {
124 if( Input.GetKey( KeyCode.Q ) == true )
125 {
126 m_CurrentMovement = -transform.right * StrafeSpeed;
127 }
128
129 if( Input.GetKey( KeyCode.E ) == true )
130 {
131 m_CurrentMovement = transform.right * StrafeSpeed;
132 }
133 }
UpdateStrafeMovement 105 lượt xem
Gõ tìm kiếm nhanh...