using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Sinx : MonoBehaviour
{ //面朝向移动速度
public float moveSpeed = 5;
//左右移动变化速度
public float changeSpeed = 2;
public float changeSize = 5f;
public float time = 0;
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
time += Time.deltaTime * changeSpeed;
this.transform.Translate(Vector3.forward * moveSpeed);
this.transform.Translate(Vector3.right * changeSize* Time.deltaTime*Mathf.Sin(time ));
}
}