UpdateJumping
How do I use Update Jumping
Below are practical examples compiled from projects for learning and reference purposes
Featured Snippets
Line | Code | Ex.. |
---|---|---|
37 | UpdateJumping(); | 1 |
52 | void UpdateJumping() | 2 |
File name: JumpAndRunMovement.cs
Copy
29 void FixedUpdate()
30 {
31 if( m_PhotonView.isMine == false )
32 {
33 return;
34 }
35
36 UpdateMovement();
37 UpdateJumping();
38 }
File name: JumpAndRunMovement.cs
Copy
52 void UpdateJumping()
53 {
54 if( Input.GetKey( KeyCode.Space ) == true && m_IsGrounded == true )
55 {
56 m_Animator.SetTrigger( "IsJumping" );
57 m_Body.AddForce( Vector2.up * JumpForce );
58 m_PhotonView.RPC( "DoJump", PhotonTargets.Others );
59 }
60 }
UpdateJumping 170 lượt xem
Gõ tìm kiếm nhanh...