Look around problems.

I made a pretty good turret in blender, imported it and made a look around script in java so it follows the character.

var LookAtTarget:Transform;

function Update ()
{
	transform.LookAt(LookAtTarget);
}

However it looks at the character with the gun bit facing in the wrong direction. How can I fix this?

That particular function (LookAt) points the subjects “Up” axis at the target. I’m sure there’s some way to correct this using code, like lookat(target * vector3.forward) or something clever, but what i would do for now, until someone who knows the real answer makes a post here, is to make the turret a child of an empty game object that’s pointing in the right direction, and put the lookAt script on that game object so that the turret is pointing the right way.

Get what I’m saying? it’s a work around, but if it works, go with it.

Are you sure about that? According to the docs, it orients the forward vector towards the target.

@The OP: How is your model oriented in local space? That is, in local space, along which axis does it point?

Also, is this orientation preserved when you import it into Unity? If you just create an empty game object and attach the model, in the scene view, which way does the model face?