public void MovePointer(float silderValue)
{
float xPos = transform.position.x + silderValue;
print(silderValue);
transform.position = new Vector3(transform.position.x + silderValue, transform.position.y, transform.position.z);
}
It printed the silderValue but it didnt change the x position of the object. I tried to type transform.position + 1, it still doesnt work. The slider value is between 0 to 1 but it should be fine
I also tried this code right here:
public float sliderValue;
public void MovePointer(float value)
{
sliderValue = value;
}
private void Update()
{
print(sliderValue);
transform.position = new Vector3(transform.position.x + sliderValue, transform.position.y, transform.position.z);
}
Still didnt work. Had me struggling for hours. Help would be appreciated.