var LookAtTarget:Transform;
var damp = 0.6;
function Update ()
{
if(LookAtTarget)
{
var rotate = Quaternion.LookRotation(LookAtTarget.position - transform.position);
transform.rotation= Quaternion.Slerp(transform.rotation,rotate,Time.deltaTime * damp);
}
transform.LookAt(LookAtTarget);
}
If an answer helped you, remember to check it as correct. It improves the search function, marks the question as finished, gives people a better impression about you (I've seen people refuse to answer a question solely because the asker doesn't check correct answers), and it gives a nice karma cookie to people who helped you.
var bullit = Instantiate(bullitPrefab,transform.Find("spawnPoint2").trasnform.position,
Quaternion.identity );
bulli.rigidbody.AddForce(transform.Forward * 10);
}
Assets/script/canoncontrol.js(18,8): UCE0001: ‘;’ expected. Insert a semicolon at the end.
Assets/script/canoncontrol.js(18,16): UCE0001: ‘;’ expected. Insert a semicolon at the end.
Assets/script/canoncontrol.js(22,7): BCE0043: Unexpected token: var.
Assets/script/canoncontrol.js(22,10): UCE0001: ‘;’ expected. Insert a semicolon at the end.
Assets/script/canoncontrol.js(26,1): BCE0044: expecting EOF, found ‘}’.
Crap, you beat me to it :D
– SrBilyon