Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using UnityEngine.Splines;
- public class Train : MonoBehaviour
- {
- SplineAnimate splineAnimator;
- public float speedIncrement = 0.005f;
- void Awake()
- {
- splineAnimator = GetComponent<SplineAnimate>();
- }
- void Update()
- {
- if (Input.GetKey(KeyCode.Space))
- {
- splineAnimator.MaxSpeed += speedIncrement;
- }
- else
- {
- splineAnimator.MaxSpeed = 1f;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement