- Home /
Question by
lorenzosindoni · Aug 31, 2021 at 09:27 AM ·
movement scriptsmooth
How can I make smooth movement ?
Hi everyone,
I would like to ask you how can I make smooth object movements in Unity ?
In my scene I have a sun that changes its position based on values detected in real-time from Arduino, actually I'm using this function but it doesn't work, because it's change like a flash and not smoothly.
private void ReadValue(int[][] packageOfData, int chnIndex)
{
for (int i = 0; i < packageOfData.Length; i++)
{
if (packageOfData[i][chnIndex] < 1000 && packageOfData[i][chnIndex] > 800)
{
if (DirectionalLight != null)
{
DirectionalLight.transform.rotation = Quaternion.Slerp(point0.rotation, pointA.rotation, timeCount);
timeCount = timeCount + Time.deltaTime;
}
}
}
}
Comment
Your answer
Follow this Question
Related Questions
endless runner movement problem 3 Answers
how to get smooth character controls? 1 Answer
How to make my 2D movement smooth 1 Answer