(Unity)オブジェクトを往復移動させる(Mathf.PingPong)

(スクリプト)

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class MoveFloor2 : MonoBehaviour
{
    private Vector3 pos;

    private void Start()
    {
        pos = transform.position;
    }

    void Update()
    {
        transform.position = new Vector3(pos.x, pos.y + Mathf.PingPong(Time.time, 13.25f), pos.z);
    }
}

(実行結果)