When i press v i want the float forwardForce to change to 70.But it says it’s value is never used even though it is used in a if statement
using UnityEngine;
using System.Collections;
public class PlayerMovement : MonoBehaviour
{
public float jumpForce = 0;
public float backwardForce = 0;
public float forwardForce = 0;
public float spinX = 0;
public float spinY = 0;
public float spinZ = 0;
private Rigidbody rb;
private void Start()
{
rb = GetComponent<Rigidbody>();
}
private void FixedUpdate()
//Movement
{
if (Input.GetKeyDown("v"))
{
float forwardForce = 70;
}
if (Input.GetKey("w"))
{
rb.AddRelativeForce(0, 0, forwardForce * Time.deltaTime, ForceMode.VelocityChange);
}