F3DTrailExample.cs 620 B

12345678910111213141516171819202122232425
  1. using UnityEngine;
  2. using System.Collections;
  3. public class F3DTrailExample : MonoBehaviour
  4. {
  5. public float Mult;
  6. public float TimeMult;
  7. Vector3 defaultPos;
  8. // Use this for initialization
  9. void Start ()
  10. {
  11. // Store initial position
  12. defaultPos = transform.position;
  13. }
  14. // Update is called once per frame
  15. void Update ()
  16. {
  17. // Used in the example scene
  18. // Moves the trail by circular trajectory
  19. transform.position = defaultPos + new Vector3(Mathf.Sin(Time.time * TimeMult) * Mult, 0f, Mathf.Cos(Time.time * TimeMult) * Mult);
  20. }
  21. }