- Home /
How do I change the position of my button on certain conditions?
Hi, in the game that I'm currently making, there is a cube as the player and it has to dodge the obstacles that comes in its way (walls, boxes etc.) and everytime the player collides with an object, a small reset screen pops up, the problem is that I want the reset button that I've already placed in the scene outside of the reset screen to change its position toward the reset screen, anyone know how to do that? Thanks in advance! (the script is applied to the player) using System.Collections; using System.Collections.Generic; using UnityEngine; public class PlayerCollision : MonoBehaviour { public static bool PlayerCollided = false; public PlayerMovement movement; void OnCollisionEnter(Collision collisionInfo) { if (collisionInfo.collider.tag == "Obstacle") { if (PlayerCollided) { Pause(); } else { Resume(); } FindObjectOfType<Gamemanage>().EndGame(); } } void Resume() { movement.enabled = false; } void Pause() { movement.enabled = true; } }
Your answer
Follow this Question
Related Questions
WorldToScreenPoint is giving me a wrong X position? 4 Answers
How to Position a GUI at the Top-Right of the Screen? 2 Answers
why doesn't my touch-position conditional statements work for mobile app? 0 Answers
Problems at using touch and buttons inputs,Problems at using touch input on Android 1 Answer