- Home /
Roll a ball camera with rotating by a mouse?
With the Unity tutorial I created a camera that follows a player (ball), but it's only follows in one rotation. I wanna create a camera that not only follows a player, but rotates around a player with mouse. Here's my code: public GameObject player; private Vector3 offset; public int speed;
private void Start()
{
offset = transform.position;
Cursor.visible = false; //Hides cursor.
}
private void Update()
{
transform.LookAt(player.transform);
transform.RotateAround(player.transform.position, Vector3.up, Input.GetAxis("Mouse X") * speed);
}
Thanks in advance!
Answer by taralees · Nov 06, 2019 at 05:40 PM
Hello;
I am getting an Error - Assets\Camera_Mouse.cs(16,105): error CS1513: } expected
I think it is a } some where / or one is missing ...I am new to this SO I could really use some help here
Thanks
Jody
Your answer
Follow this Question
Related Questions
need help with roll a ball like game 0 Answers
Forward and back movements with a camera emulating an isometric view 1 Answer
Adjust camera orientation through code 0 Answers
Camera isn't following mouse in FPS 0 Answers
Why is Camera turning different than Player with same code in different scripts? 1 Answer