Advertisement
xxsmarioxxs

Untitled

Mar 31st, 2020
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. if (Input.GetMouseButtonDown(0))
  2. {
  3. Vector3 mousePos = Camera.main.ScreenToWorldPoint(Input.mousePosition);
  4. Vector2 mousePos2D = new Vector2(mousePos.x, mousePos.y);
  5.  
  6. RaycastHit2D hit = Physics2D.Raycast(mousePos2D, Vector2.zero);
  7. if (hit.collider != null)
  8. {
  9. if (hit.transform.tag == "Mensch" && hit.transform.gameObject == specificHuman)
  10. {
  11. if (hit.transform.gameObject.name.Contains("People"))
  12. {
  13. nameText.text = "Tommy";
  14. menschImage.sprite = menschenSprites[0];
  15. }
  16. einreisePanel.SetActive(true);
  17. human = hit.transform.gameObject;
  18. raycastAllowed = false;
  19. }
  20. }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement