using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ggg : MonoBehaviour
{
Vector3 startPosition;
// Start is called before the first frame update
void Start()
{
startPosition = transform.position;
}
// Update is called once per frame
void Update()
{
Vector3 nowPosition = transform.position;
if(nowPosition.y != startPosition.y)
{
float dif = nowPosition.y - startPosition.y;
float m;
if(dif >= 0.1f)
{
m = 0.1f;
}
else
{
m = dif;
}
transform.position = new Vector3(nowPosition.x, nowPosition.y - m, nowPosition.z);
}
}
}
https://github.com/user-attachments/assets/1bde490e-7eb3-47d7-bbcf-205e0adae417