Hi !

I have a script for a game causing an error, and i don’t anderstant why … ?

The script :

```
void Update()
{
float headDisplacement = (head.position - breadcrumbs[0]).magnitude;
if (headDisplacement >= segmentSpacing)
{
breadcrumbs.RemoveAt(breadcrumbs.Count - 1); //remove the last breadcrumb
breadcrumbs.Insert(0, head.position); // add a new one where head is.
headDisplacement = headDisplacement%segmentSpacing;
}
if (headDisplacement != 0)
{
Vector3 pos = Vector3.Lerp(breadcrumbs[1], breadcrumbs[0], headDisplacement / segmentSpacing);
segments[0].position = pos;
segments[0].rotation = Quaternion.Slerp(Quaternion.LookRotation(breadcrumbs[0] - breadcrumbs[1]), Quaternion.LookRotation(head.position - breadcrumbs[0]), headDisplacement / segmentSpacing);
for (int i = 1; i < segments.Length; i++)
{
pos = Vector3.Lerp(breadcrumbs[i + 1], breadcrumbs*, headDisplacement / segmentSpacing);*
```

_ segments*.position = pos;*_
segments.rotation = Quaternion.Slerp(Quaternion.LookRotation(breadcrumbs _- breadcrumbs[i + 1]), Quaternion.LookRotation(breadcrumbs[i - 1] - breadcrumbs), headDisplacement / segmentSpacing);
}
}*_*

** }**

*Error :*

*> Look rotation viewing vector is zero*

*> UnityEngine.Quaternion:LookRotation(Vector3)*

*> Snake:Update() (at*

*> Assets/Scripts/Snake.cs:49)*

*The line causing problem :*

*segments[0].rotation = Quaternion.Slerp(Quaternion.LookRotation(breadcrumbs[0] - breadcrumbs[1]), Quaternion.LookRotation(head.position - breadcrumbs[0]), headDisplacement / segmentSpacing);*