v7 slow talking :D

This commit is contained in:
2018-11-15 14:11:50 +01:00
parent 131529576c
commit bf92632485
6 changed files with 49 additions and 14 deletions
+20 -2
View File
@@ -13,6 +13,7 @@ public class Walk : MonoBehaviour
for (int index = 0; index < legs.Count; ++index)
{
legsInitial.Add(legs[index].GetComponent<Leg>().point);
step2.Add( new Vector3() );
}
}
@@ -61,6 +62,8 @@ public class Walk : MonoBehaviour
public float walkspeed = 1;
private List<Vector3> step2 = new List<Vector3>();
// Update is called once per frame
void FixedUpdate()
{
@@ -85,17 +88,32 @@ public class Walk : MonoBehaviour
t2.x *= walkspeed;
// rotate x,y around rotation.
legs[index].GetComponent<Leg>().point += Quaternion.Euler(0, rotation, 0) * t2;
step2[index] = (Quaternion.Euler(0, rotation, 0) * t2) / speed2;
}
else
{
legs[index].GetComponent<Leg>().point = legsInitial[index] + s[t].pos;
Vector3 t2 = s[t].pos;
t2.x *= walkspeed;
// rotate x,y around rotation.
step2[index] = (Quaternion.Euler(0, rotation, 0) * t2) / speed2;
}
}
speed = speed2;
}
else
{
speed--;
makestep();
}
}
void makestep()
{
for (int index = 0; index < legs.Count; ++index)
{
legs[index].GetComponent<Leg>().point += step2[index];
}
}
}