I wonder how I can move an object in the opposite direction of the camera.
Example: When I move the camera to the right at any position (0,30,0), the object moves in the opposite direction (0, -30,0) to the left.
I wonder how I can move an object in the opposite direction of the camera.
Example: When I move the camera to the right at any position (0,30,0), the object moves in the opposite direction (0, -30,0) to the left.
I got it like this:
void Update ()
{
rot = Cardboard.SDK.HeadPose.Orientation;
transform.localEulerAngles = (Vector3.down * rot.eulerAngles.y);
}
Rotating around the camera.
You should first access the Camera. It has many forms, judging that you already know how to do this, you can do the following:
transform.rotation = Quaternion.Inverse(ObjCamera.transform.rotation);
For more information on the Quaternion Class (Rotation): Quaternion