
질문이 많아서 죄송한데여

자꾸 막히니까 포기하고싶네요;;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class rtan : MonoBehaviour
{
float direction = 0.05f;
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
if (transform.position.x > 2.8f)
{
direction = -0.05f;
}
if (transform.position.x < 2.8f)
{
direction = 0.05f;
}
transform.position += new Vector3(direction, 0, 0);
}
}
