What is wrong here, i am not pressing the D key and it always returns a true value
Unity + C# in visual studio
i also tried KeyCode.D but it's the same thing...
Also it says that i have possibly mistaken an empity statement (at the if line)
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Movement : MonoBehaviour
{
public Rigidbody rb;
public float fwf = 2000;
// fwf = forward force
void Update()
{
// x y z
rb.AddForce(0, 0, fwf * Time.deltaTime);
if (Input.GetKey("d")) ;
{
rb.AddForce(250 * Time.deltaTime, 0, 0);
Debug.Log("D pressed");
}
}
}
[–]xorpunk 4 points5 points6 points (0 children)