Error Console
Assets/playerMovement.cs(20,63): error CS0019: Operator +' cannot be applied to operands of type UnityEngine.Vector3’ and `float’
Error Highlighted Code (C#) Line 6
if (Input.GetKey ("a"))
{
//If "a" key is pressed if statement is true ---True---
if (Input.GetKeyDown ("lshift"))
{
rigidbody.position += Vector3.left * PlayerSpeed + 5 * Time.deltaTime;
}
rigidbody.position += Vector3.left * PlayerSpeed * Time.deltaTime;
}
This is a movement script, i want to add 5 to the current value before moving.
The lshist (Left Shift) (not sure if i got the correct text) is a sprint button so the value of the players speed will double, rather not play with the variable and set it to 10 and back to 5, i thought adding 5 if shift is pressed will work.