I just started at this and I can’t find the problem can someone help me?
Problem is at this part if:
((Input.GetKey (“w”) (Input.GetKey (“shift”)))
{
rb.AddForce (0, 0, forwardForceShift * Time.deltaTime);
}
using UnityEngine;
public class PlayerMovement : MonoBehaviour {
public Rigidbody rb;
public float forwardForceShift = 1000f;
public float forwardForce = 500f;
public float sidewaysForce = 500f;
void FixedUpdate ()
{
if ((Input.GetKey ("w") (Input.GetKey ("shift")))
{
rb.AddForce (0, 0, forwardForceShift * Time.deltaTime);
}
if (Input.GetKey("w"))
{
rb.AddForce(0, 0, forwardForce * Time.deltaTime);
}
if (Input.GetKey("d"))
{
// Add a force to the right
rb.AddForce(sidewaysForce * Time.deltaTime, 0, 0);
}
if (Input.GetKey("a"))
{
// Add a force to the left
rb.AddForce(-sidewaysForce * Time.deltaTime, 0, 0);
}
}
}