So I need an answer for this one, My slider value changes and sends to other scripts correctly but the actual in game slider doesn’t move at all, just a limp red line. heres my code:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class PowerSlider : MonoBehaviour {
public void OnValueChange(float value) {
Debug.Log("New Value " + value);
}
public float Values;
public Slider PowerS;
private bool Continue = true;
public bool Stop = false;
// Use this for initialization
private playerMotor PM;
private void Awake()
{
PM = GameObject.FindObjectOfType();
}
void Start () {
PowerS.value = Values;
PowerS.maxValue = 50f;
PowerS.minValue = 1f;
}
// Update is called once per frame
void Update()
{
if (Input.GetKeyDown("space"))
{
Stop = true;
PM.Ustarts(Stop, Values);
}
if (Stop == false)
{
if (Continue == true)
{
Values = Values + 0.5f;
if (Values == 50f) { Continue = false; };
}
else
{
Values = Values - 0.5f;
if (Values == 1f) { Continue = true; };
};
}
}
}