using System.Collections; using System.Collections.Generic; using UnityEngine; /// /// This script moves the attached object along the Y-axis with the defined speed /// public class DirectMoving : MonoBehaviour { [Tooltip("Moving speed on Y axis in local space")] public float speed; //moving the object with the defined speed private void Update() { transform.Translate(Vector3.up * speed * Time.deltaTime); } }