TheKingsRace/Assets/Addons/CameraPathCreator/DEMO/CPC_DEMO_UpDown.cs

22 lines
428 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CPC_DEMO_UpDown : MonoBehaviour
{
private Vector3 startPos;
public float height;
public float speed;
void Start()
{
startPos = transform.position;
}
// Update is called once per frame
void Update ()
{
transform.position = startPos + Vector3.up * height * Mathf.Sin(Time.time * speed);
}
}