Trigger enter, move an object to x,y and z co-ordinates.

Hey everyone.
I have a scene set up with a player using the fps controller. I also have a box, with no mesh renderer, and trigger set to on.
I would like a snippet of code that when the player walks inside the cube trigger, that it moves another object in the scene into view of the player.
I want to be able to make the player walk up to a log, and a plane textured with info will rise up for the player to read, and dissapear when they walk away.

Please help as this is urgent and i can’t script.

public Transform sign;
public Vector3 signTargetOffset;
public float raiseTime = 2;
Vector3 signStart;
Vector3 signTarget;

public GameObject player;

void Start()
{
    signStart = sign.position;
    signTarget = signStart + signTargetOffset;
}

void OnTriggerEnter(Collider other)
{
    if(other.gameObject == player)
    {
        StartCoroutine(RaiseSign(raiseTime));
    }
}

IEnumerator RaiseSign(float time)
{
    float elapsedTime = 0;
    while(elapsedTime < time)
    {
        sign.position = Vector3.Lerp(signStart, signTarget, elapsedTime / time);
        elapsedTime += Time.deltaTime;
        yield return null;
    }
    sign.position = signTarget;
}

Put this on your trigger volume, then drag the gameObjects for the sign, and the player onto the view the script gives you in the inspector, and tell it how far the sign should move when it rises, and how long it should take.

@syclamoth I’m really hoping you are still active on the unity store because i am desperate, i have all your code entered (Had to type it in, copy and paste wouldn’t work xD) and i have all the options in the inspector but it just doesn’t do anything when my character collides with the trigger :confused: idk what to do. (also relatively new to scripting)

my script:

using UnityEngine;
using System.Collections;

public class NewBehaviourScript : MonoBehaviour {
	public Transform sign;
	public Vector3 signTargetOffset;
	public float raisetime = 2;
	Vector3 signStart;
	Vector3 signTarget;

	public GameObject player;
	void Start()
	{
		signStart = sign.position;
		signTarget = signStart + signTargetOffset;
	}
	void OnTriggerEnter(Collider other)
	{
		if (other.gameObject == player) {
			StartCoroutine (RaiseSign (raisetime));
		}
	}
	IEnumerator RaiseSign(float time)
	{
		float elapsedTime = 0;
		while (elapsedTime < time) {
			sign.position = Vector3.Lerp (signStart, signTarget, elapsedTime / time);
			elapsedTime += Time.deltaTime;
			yield return null;
		}
		sign.position = signTarget;

		}
}