Looking-Glass/Assets/testscene/test.cs

21 lines
457 B
C#
Raw Normal View History

2024-02-02 12:54:47 +01:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class test : MonoBehaviour
{
// Start is called before the first frame update
bool shouldmove = false;
public void startmove(){
shouldmove = true;
}
// Update is called once per frame
void Update()
{
if(shouldmove && transform.position.y <= 2){
transform.position += new Vector3(0f, 0.02f, 0f);
}
}
}