I am making a game about 4 players contending for an area. When pressing the interact button you’re supposed to be able to spread your territory. However when a button is pressed on a controller each game object on a controller spreads its territory, given that the other requirements are met. Any ideas?
private void PlaceFog3(GameObject instance, Witch witch)
{
if (!witch.IsInFog && Physics.CheckSphere(instance.transform.position, 2, _fogLayerMask) && Input.GetButtonDown(“Interact 2”) && !Physics.CheckSphere(_witchInstances[0].transform.position, 2, LayerMask.GetMask(“Ingredient”)))
{
GameObject fog = Instantiate(_fogPrefab, instance.transform.position, Quaternion.identity);
witch.AddFog(fog.transform.position);
}
}
private void PlaceFog4(GameObject instance, Witch witch)
{
if (!witch.IsInFog && Physics.CheckSphere(instance.transform.position, 2, _fogLayerMask) && Input.GetButtonDown(“Interact 3”) && !Physics.CheckSphere(_witchInstances[0].transform.position, 2, LayerMask.GetMask(“Ingredient”)))
{
GameObject fog = Instantiate(_fogPrefab, instance.transform.position, Quaternion.identity);
witch.AddFog(fog.transform.position);
}