Quantcast
Channel: Questions in topic: "error message"
Viewing all articles
Browse latest Browse all 2891

Jumping Problem

$
0
0
I am making a simple game and i need my player to jump. They way i want to do it i get the error: Operator '&&' cannot be applied to operands of type 'bool' and 'float'. Here is my script: public class Jump : MonoBehaviour { public Rigidbody rb; public float UpForce = 2000f; public float jumpCount; void FixedUpdate() { if (Input.GetKey("w") && jumpCount = 0) { rb.AddForce(0, UpForce * Time.deltaTime, 0, ForceMode.Impulse); jumpCount = 1f; } } void OnCollisionEnter(Collision collisionInfo) { if (collisionInfo.collider.tag == "Floor") { jumpCount = 0f; } }

Viewing all articles
Browse latest Browse all 2891

Trending Articles



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