|
Post by astralflux on Feb 22, 2022 2:11:49 GMT
Im hoping someone may be able to give me a hand with this.
I have a Slider which adjusts the agent offset base.
I would like to only adjust the offset once mouse click has been released, and to gradually move to the newly set height.
Right now the navmesh agent instantaniously jumps to the height set by the slider while moving the handle.
I've looked at a couple of solutions but havent had luck setting it up correctly.
Im using this to simulate a flying drone which takes orders from the invector controller. I need to adjusts its height..
using UnityEngine;
using UnityEngine.UI;
[RequireComponent(typeof(Slider))]
public class SliderTimer : MonoBehaviour
{
public float FillTime = 1.0f;
public float minValue = 1;
public float maxValue = 2;
private Slider _slider;
void Start()
{
_slider = GetComponent<Slider>();
}
void Update()
{
_slider.value = Time.time;
}
}
Thank you if you have any insights to this...
|
|