- Home /
Duplicate Question
How do I rotate my Camera around my sphere using the arrow keys?
My code is currently this, also it's not much however please add onto it.
public GameObject playerpos; private float distancey = 3.0f; private float distancex = -4.0f;
void Update() {
transform.position = new Vector3(playerpos.transform.position.x + distancex,
playerpos.transform.position.y + distancey,
playerpos.transform.position.z);
}
You've had your question rejected several times in the $$anonymous$$oderation queue. This question has been answered a number of times in Unity Answers. Please search out the answers. If you get stuck, post back with your attempt. Note that saying "please add what you think needs to be added" makes this a write-it-for-me question. We answer single single specific technical questions to help you write your own code. Here is the setup for one solution:
Position your camera facing the sphere, put an empty game object at the center of the sphere, make the camera a child of the empty game object. Use Transform.Rotate() to rotate the empty game object.
Follow this Question
Related Questions
Flying/hover script? 1 Answer
Spotlight Help 0 Answers
Damage on collision 1 Answer
What's wrong with this code and is there an easier way to write it!? 1 Answer
Is 360° the same as 0°? 2 Answers