Hi there, I want to create people that move around randomly. I now have
var chicken : Transform;
var vel : Vector3;
var Direction : float = 3;
var curTime : float = 0;
function Start() {
SetVel();
}
function SetVel() {
if (Random.value > .5) {
vel.x = 5 * 5 * Random.value;
}
else {
vel.x = -5 * 5 * Random.value;
}
if (Random.value > .5) {
vel.z = 5 * 5 * Random.value;
}
else {
vel.z = -5 * 5 * Random.value;
}
}
function Update() {
SetVel();
if (Random.value > .5) {
Direction += Random.value;
}
else {
Direction -= Random.value;
}
if (Direction < 1) {
Direction = 1 + Random.value;
}
curTime = 0;
}
function FixedUpdate() {
chicken.GetComponent.<Rigidbody>().velocity = vel;
}
but this just makes people (I’m using a cube for testing purposes) move around really shaky. Is there a way to make it more clean/smooth?