I know it seems so simple, but I’ve been working on this for several hours now and I feel like I have tried everything I can find on unity3d.com, google and youtube. It is for a simple whack-a-mole game.
I at least have everything moving to a fixed location, but it is using world space and I haven’t figured out a way to have it occur over 1 second of real time. Could someone point me in the right direction? I’d like to have each instance of this prefab move up 1 unit when it is instantiated, wait several seconds, and then move down. This is the script I have attached to my prefab:
static var moveSpeed:float = 10.0;
function Update () {
var bottomPosition:Transform;
var topPosition = Vector3(0,1,0);
moleAlive = true;
gameObject.transform.position = Vector3.Lerp(transform.position, topPosition, (Time.deltaTime * moveSpeed));
}