- 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);
- }
- }