How can i get a object to aim one of its axis at another object, and keep aiming when the target object move? Preferably using javscript.
Is it also possible to give the object a up aim axis. So the object stays up-rigth and dont flip when its aiming at a moving object? Also preferably using javscript.
This example (from that documentation page) does exactly what you want:
// The target variable shows up as a property in the inspector.
// Drag another object onto it to make the camera look at it.
var target : Transform;
// Rotate the camera every frame so it keeps looking at the target
function Update() {
transform.LookAt(target);
}