Quantcast
Channel: Questions in topic: "issue"
Viewing all articles
Browse latest Browse all 827

Double jump script issue

$
0
0
Hi all. First of all I must tell you that I have fix the fixed timeStep to 0.008 to disable that bouncy effect on collision. There is my script, the problem is that when I click one time to jump the script run 2 time for 1 click. With only one click to do a simple jump my player object is jumping 2 time instead of 1. This code is called in fixed update : public void Jump(Rigidbody _Rb, float _jumpForce, int _jumpCount) { if (_jumpCount > 0) { if (Input.GetMouseButtonDown(0) || Input.touchCount > 0) { PlayerController.jumpCount --; _Rb.AddForce(Vector3.up * _jumpForce); Debug.LogFormat("jump"); } } }

Viewing all articles
Browse latest Browse all 827

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>