- Home /
Question by
gabeljicemina1 · Jun 28, 2020 at 07:20 PM ·
camerarotationsphere
Camera rotation around the sphere
Hello everyone, does anyone know how to rotate the camera around the sphere player while dragging the left mouse button and also going into the direction of the camera, I am making a 3d game and a player already has a movement script:
public class AddConstantVelocity : MonoBehaviour { [SerializeField] Vector3 v3Force;
[SerializeField]
KeyCode keyPositive;
[SerializeField]
KeyCode keyNegative;
void FixedUpdate()
{
if (Input.GetKey(keyPositive))
GetComponent<Rigidbody>().velocity += v3Force;
if (Input.GetKey(keyNegative))
GetComponent<Rigidbody>().velocity -= v3Force;
}
}
How to rotate the camera around while dragging the left mouse button, and let that sphere player go in the direction of the camera. Thanks.
Comment
Your answer
Follow this Question
Related Questions
Camera And player rotation 0 Answers
Third person follow camera on a sphere 1 Answer
Roll-a-Ball Tutorial Camera still doing loop de loop as it follows the sphere. 1 Answer
Camera/Direction Rotation 2 Answers
"Free" rotation about a sphere 0 Answers