Ok, so I think I do the why, I am hoping that someone can help me fix this issue.
In short, I have a gameObject (a boss character) that teleports around the screen. At the beginning of the battle, his music plays. Every few seconds, his animation runs and then he teleports again to a different area of the screen. Everything works fine, except that the background music always “stutters” when he teleports. It doesn’t stop, doesn’t go back to the start of the track, but it’s not seamless, and I’d like it to be. Any advice / help would be humbly appreciated. Thanks, and God bless.
var target : Transform;
var moveSpeed = 20;
var rotationSpeed = 5;
var myTransform : Transform;
var minDistance = 30;
var follow : boolean = true;
var damage = 250;
var canBeAttacked = true;
var Medamomo : GameObject;
var destination : Transform;
var destination2 : Transform;
var destination3 : Transform;
var destination4 : Transform;
var destination5 : Transform;
function Awake()
{
myTransform = transform;
}
function Start()
{
target = GameObject.FindWithTag("Player").transform;
audio.Play(); **//HERE!!! LOOK!!!**
}
function Update () {
if(Vector3.Distance(myTransform.position, target.position) < minDistance)
Move();
}
function Move(){
Medamomo.transform.position = destination.position;
Medamomo.animation.Play();
yield WaitForSeconds (7.0);
Medamomo.transform.position = destination2.position;
yield WaitForSeconds (7.0);
Medamomo.animation.Play();
yield WaitForSeconds (7.0);
Medamomo.transform.position = destination3.position;
Medamomo.animation.Play();
yield WaitForSeconds (7.0);
Medamomo.transform.position = destination4.position;
Medamomo.animation.Play();
yield WaitForSeconds (7.0);
Medamomo.transform.position = destination5.position;
Medamomo.animation.Play();
}