Switch scenes problem with the canvas
Hi! Can anyone help me with the problems that I am facing while I am struggling to finish the design of my game please? I will add him/her on my credits! The game is a bowling. 1. How can I add an image "Game Over" in my scene through the code which counts the scores? The game stops when it completes the 10th box. 2. I created a capsule-player and a camera which follows the player. However the rotation doesn't apply to my player.
public class PlayerExploring : MonoBehaviour { public Transform player; public float moveSpeed;
public Transform camPivot;
public float turnSpeed;
//public Vector3 offset;
// Update is called once per frame
void Update()
{
if (Input.GetKey(KeyCode.A))
{
player.Translate(Vector3.left *moveSpeed*Time.deltaTime);
}
if (Input.GetKey(KeyCode.D))
{
player.Translate(Vector3.right * moveSpeed * Time.deltaTime);
}
if (Input.GetKey(KeyCode.W))
{
player.Translate(Vector3.forward * moveSpeed * Time.deltaTime);
}
if (Input.GetKey(KeyCode.S))
{
player.Translate(Vector3.back * moveSpeed * Time.deltaTime);
}
//cam.LookAt(player);
//cam.position = player.position + offset;
camPivot.position = Vector3.MoveTowards(camPivot.position, player.position, moveSpeed * Time.deltaTime);
camPivot.rotation = Quaternion.RotateTowards(camPivot.rotation, player.rotation, turnSpeed * Time.deltaTime);
player.Rotate(Input.GetAxis("MouseX") * Vector3.up * turnSpeed);
}
}
In scene 1, I have the start button. By clicking that, the game begins-moves to scene 2. The score board appears in white and the exit button doesn't appear!

I think you should work on your question because it looks like 4 questions in one thread.
Your answer
Follow this Question
Related Questions
Giving a UI button a Color at Start 0 Answers
Can't click on a button; nothing happens when clicking 0 Answers
High CPU usage with UI elements. 0 Answers