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

The best overloaded method match for `UnityEngine.Rigidbody.AddForce(UnityEngine.Vector3, UnityEngine.ForceMode)' has some invalid arguments

$
0
0
I have this error. can someone help me? Thanks in Advance. using UnityEngine; using System.Collections; public class PlayerMove : MonoBehaviour { public float speed; public float backSpeed; public float jumpVelocity; private bool isGrounded; void Awake(){ Rigidbody rigid = GetComponent(); } void Start(){ } void Update(){ if(Input.GetButtonDown("Jump")){ if(isGrounded){ rigidbody.AddForce(jumpVelocity, ForceMode.VelocityChange); isGrounded = false; } } } void FixedUpdate () { if(isGrounded){ if(Input.GetKey(KeyCode.W)){ rigidbody.AddForce(0f, 0f, backSpeed, ForceMode.Acceleration); } else if(Input.GetKey(KeyCode.S)){ rigidbody.AddForce(0f, 0f, backSpeed, ForceMode.Acceleration); } } } }

Viewing all articles
Browse latest Browse all 7934

Trending Articles



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