This code is in the update function. I tested some stuff out and instead of -= or +=, i just did = and it worked. Is there something wrong with the code?
if (Input.touches[0].position.x < 100) {
xSpeed -= 0.3f;
}else if (Input.touches[0].position.x >= 100) {
xSpeed += 0.3f;
}
↧