Problem with a script

Hi guys,
I’ve got two problem.
the first is : how can i activate these funtion only if i’m near the enemy?
can you change my script please?
using UnityEngine;
using System.Collections;
public class A : MonoBehaviour {

public Transform pl;

// Use this for initialization
void Start () {
}

// Update is called once per frame
void Update ()
{
transform.LookAt (pl);
transform.position = Vector3.Lerp(transform.position, pl.position,0.025f);
}
the second is : can you wrute for me a script for save the dates in a game thank you before :slight_smile:
PS: i’m italian so my inglish is bad bye ^^

I’m sorry if I come off as rude, but nobody is going to just write a script for you. To get help on these forums you need to show that you are willing to learn. I am, however, wanting to help. I’m just telling you this for future questions because your thread was sinking to the bottom of the forums :smile:. For your first question look into this function or this function. Also make sure to learn how to use triggers in Unity. For your second question look into this class.

Thank you very much i’m new so i didn’t now that i can’t i’m sorry and i will never do in future :frowning: