- Home /
Audio stutters at gameObject teleport
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();
}
Answer by Conect11 · Nov 12, 2013 at 11:23 PM
nope, don't have any other sounds attached to him, and not sure how to check for lag spikes. That said, I decided to move the song file from the boss character to a stationary object. (a gate) Issue is resolved. :) Thanks!
Your answer
Follow this Question
Related Questions
AudioMixer Bug - Am I doing something wrong? 0 Answers
Audio for movement 1 Answer
iOS "Mute other audio sources" disabled but not working 2 Answers
Random footsteps 5 Answers