In the code below I am controlling a player ship and there is a problem with not being able to move while holding down the fire button (right control).
Can anyone help please?
if (Input.GetAxis("Horizontal") == -1)
{
shipVelocity.x -= hVelStep * Time.deltaTime * speedMult;
}
else if (Input.GetAxis("Horizontal") == 1)
{
shipVelocity.x += hVelStep * Time.deltaTime * speedMult;
}
else
{
shipVelocity.x /= hVelDrag;
}
if (Input.GetButtonDown("Fire2") missileCount < maxMissiles missileTCount > missileTDelay)
{
FireMissile();
missileCount +=1;
missileTCount = 0.0f;
}
if (Input.GetButtonUp("Fire2")) missileTCount = missileTDelay;
missileTCount += 1 * Time.deltaTime;