Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using System.Collections;
- public class ObjectRaisingScript : MonoBehaviour {
- public float tranformY = -100.0f;
- public float proximityToPlayerX = 40.0f;
- public float proximityToPlayerZ = 40.0f;
- public int speedOfFadeIn = 100;
- public GameObject target;
- private bool isActive = false;
- // Use this for initialization
- void Start ()
- {
- transform.position += new Vector3(0.0f, tranformY, 0.0f);
- }
- // Update is called once per frame
- void Update ()
- {
- if(isActive == false
- && (Mathf.Abs (target.GetComponent<Transform>().position.x - transform.position.x) < proximityToPlayerX
- && Mathf.Abs (target.GetComponent<Transform>().position.z - transform.position.z) < proximityToPlayerZ))
- {
- isActive = true;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement