- Home /
Adjust Agent Base offset via Slider,Adjusting agent offbase height via slider
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.
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
Your answer
Follow this Question
Related Questions
Click to move, navAgent and mecanim = animation playing too early 0 Answers
How to move a single specific NavMesh agent? 2 Answers
How do I get NavMeshAgents not to walk through objects? 3 Answers
gameobject.GetComponent().target is not working 1 Answer
"SetDestination" can only be called on an active agent that has been placed on a NavMesh. 0 Answers