Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using Vuforia;
- public class NewBehaviourScript : MonoBehaviour
- {
- // Start is called before the first frame update
- void Start()
- {
- }
- Transform target;
- void GetHouseTarget()
- {
- GameObject go = GameObject.Find("ImageOat");
- if (go != null)
- {
- target = go.transform;
- }
- else
- {
- Debug.Log("House not found");
- }
- }
- // Update is called once per frame
- void Update()
- {
- float distance = Vector3.Distance(transform.position, target.position);
- if (distance < 5)
- {
- print("THEY ARE CLOSE");
- }
- else
- {
- print("THEY ARENT CLOSE");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement