I have this following code in a FixedUpdate() method with a Input.GetMouseButton(0) condition: Code (CSharp): public void playerAttack() { RaycastHit hit; if (Physics.Raycast(player.transform.position, player.transform.forward, out hit, range)) //range = 7f { if (hit.rigidbody != null && hit.transform.tag == "Enemy") { Vector3 dir = new Vector3(hit.transform.position.x, hit.transform.position.y, hit.transform.position.z - 100f); hit.transform.GetComponent<Rigidbody>().AddForce(dir * weaponPush * Time.deltaTime); //weaponPush = 1f } } } The enemy object has rigidbody on it and isKinematic is not selected. It still doesn't move when I am almost in front of it and click the left mouse button.
I would guess in FixedUpdate() you are calling playerAttack() every frame? The problem I can see is that your program may be running at 1000fps, yet fixedUpdate is possibly only running at 60fps. Try moving the method involving the Input.GetMouseButton to update and see if it works then!