Question by
gaminggamergamer · Aug 18, 2021 at 03:46 AM ·
boolean
Bool is allways true
in this code the bool is always true ' public class PlayerTracker : MonoBehaviour { public GameObject Playerone; public GameObject Playertwo; public bool Playertype;
// Update is called once per frame
void Update()
{
if (Input.GetKeyDown(KeyCode.Q))
{
Playertype = false;
}
if (Input.GetKeyDown(KeyCode.E))
{
Playertype = true;
}
if (Playertype == false)
{
transform.position = Playerone.transform.position;
}
if (Playertype == true)
{
transform.position = Playertwo.transform.position;
}
}
} '
Comment
Your answer