Question by
kyliee08 · Sep 22, 2017 at 03:53 PM ·
beginnergameobjectsif statementdrop
i tried to make an if statement that 2 gameobjects are drop in a same position to enable another gameobject but it's not working
public class drop : MonoBehaviour, IDropHandler { public GameObject[] color;
public void OnDrop(PointerEventData data)
{
if (data.pointerDrag != null){
Debug.Log ("Dropped object was: " + data.pointerDrag);
}
if (gameObject.name == "black" && gameObject.name =="white")
{
for (int i = 0; i < color.Length; i++)
color [i].SetActive (true);
}
}
Comment
Your answer
Follow this Question
Related Questions
How to spawn in the end room randomly? 0 Answers
Cant stop Movetowards, already tried transform.position=end.position 1 Answer
Collisor bug? 0 Answers
Kit Puzzle restart issue 0 Answers
How do I get my character to shoot towards my mouse in a 2D top down? 0 Answers