Newer
Older
Dreamsturbia-Project-IADE-Unity3D / Assets / Scripts / Puzzles / CargoElevatorScript.cs
@Rackday Rackday on 21 Aug 587 bytes Project Added
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class CargoElevatorScript : MonoBehaviour
{
    public Vector3 targetPosition;
    public Vector3 basePosition;
    public ConditionCkecker condition;
    // Start is called before the first frame update
    void Start()
    {
        basePosition = transform.position;
    }

    // Update is called once per frame
    void Update()
    {
        if (condition.CheckConditions()) 
        transform.position = Vector3.MoveTowards(transform.position, targetPosition,Time.deltaTime);        

    }
}