Actually I have came here after searching from past 5-6 hours. Actually I am making a small game in which I have a camera and a gameobject. The Game Object is place in the center of the scene at 0,0,0 . My scene doesn't include anything but a skybox. I wanted to move my camera with gyro input, I got that working. My problem is that I want my object which is at 0,0,0 is to face camera always. The camera is controlled by gyro so the object should always remain infront of the camera. I have taken a script from wiki.unity3d and it seems to be somewhat working. Actually I want an offset for the transform.lookAt or if it's not possible I'll require some solution for it.
public class CameraFacing : MonoBehaviour
{
public Camera m_Camera;
void Update()
{
transform.LookAt((transform.position) + m_Camera.transform.rotation * Vector3.forward,
m_Camera.transform.rotation * Vector3.up);
}
}
Actually I have tried 3rd person and FPS shooter camera and Camera Follow script as well besides knowing it doesn't fit my need. As In most cases we want the camera to follow object. But in this case my input is through gyro of mobile device and I want the center object to always remain in front of camera.