I have a prefab projectile with a script on it that determines its movement. I had been modifying the values of the variable in a the provided text editor with the changes being applied to the prefab. This has stopped happening. Now I need to go to the prefab in the inspector and edit it there, reset the script from there. Why did this start happening and how can I fix it?
using UnityEngine;
using System.Collections;
public class tidy : MonoBehaviour {
public float CurveSpeed = 10;
//public float MoveSpeed = 1;
float fTime = 0;
Vector3 vLastPos = Vector3.zero;
// Use this for initialization
void Start () {
Destroy(gameObject,20);
}
public float speed= 5;
public int count=0;
// Update is called once per frame
void Update () {
vLastPos = transform.position;
fTime += Time.deltaTime * CurveSpeed;
Vector3 vSin = new Vector3(0, -Mathf.Sin(fTime), 0);
Vector3 vLin = transform.forward*speed;
transform.position += (vSin + vLin) * Time.deltaTime;
Debug.DrawLine(vLastPos, transform.position, Color.green, 100);
}
}