Normalized.time being funky

Dear all, long time reader first time caller

anyway, I have a basic animation which is controlled by a slider ex:

var spot : float = 0.0;

function start() {

  animation["myanim"].enabled = true;
  animation["myanim"].weight = 1.0;
  animation["myanim"].speed = 0;

}

function update (){
  animation["myanim"].nomalizedTime = spot;

function ONGui(){

  spot = Horizontalslider.(rect(10, 10, 100, 30)spot, 0.0, 1.0);

and it works and all, except the animation runs incorrectly. It’s a finger curling with each bone curling individually, however it does curl all the way, and yet in the editor it does.

Any thoughts? Is the situation clear enough?

THanks
Jason

little update

I added a second script that is suppose to play the animation whe I press J, instead it makes the slider work correctly for one of the animations, the other slider animations stop working all together.

Can you post the whole script? There are a couple of syntax errors in the code you’ve posted (I think you’ve re-typed what was in the original script) and it isn’t easy to see what might be causing the problem.

here’s the code

var spot : float = 0.0;
var spot2 : float = 0.0;
var spot3 : float = 0.0;
var spot4 : float = 0.0;
var spot5 : float = 0.0;


function Start() {
	

	
	animation["1st_Digit"].weight = 1;
	animation["1st_Digit"].enabled = true;
	animation["1st_Digit"].speed = 0;
	
	animation["2nd_Digit"].weight = 1;
	animation["2nd_Digit"].enabled = true;
	animation["2nd_Digit"].speed = 0;
	
	animation["3rd_digit.001"].weight = 1;
	animation["3rd_digit.001"].enabled = true;
	animation["3rd_digit.001"].speed = 0;

	animation["4th_Digit.001"].weight = 1;
	animation["4th_Digit.001"].enabled = true;
	animation["4th_Digit.001"].speed = 0;

	animation["5th_Digit"].weight = 1;
	animation["5th_Digit"].enabled = true;
	animation["5th_Digit"].speed = 0;
	
	}


function Update () {

	
	animation["1st_Digit"].normalizedTime = spot;
	animation["2nd_Digit"].normalizedTime = spot2;
	animation["3rd_digit.001"].normalizedTime = spot3;
	animation["4th_Digit.001"].normalizedTime = spot4;
	animation["5th_Digit"].normalizedTime = spot5;
	

}

function OnGUI() {
	spot= GUI.VerticalSlider (Rect(Screen.width - 120, 10, 30, 100), spot, 0.0, 1.0);
	Debug.Log(spot);
	spot2= GUI.VerticalSlider (Rect(Screen.width - 100, 10, 30, 100), spot2, 0.0, 0.5);
	spot3 = GUI.VerticalSlider (Rect(Screen.width - 80, 10, 30, 100), spot3, 0.0, 0.5);
	spot4 = GUI.VerticalSlider (Rect(Screen.width - 60, 10, 30, 100), spot4, 0.0, 0.5);
	spot5 = GUI.VerticalSlider (Rect(Screen.width - 40, 10, 30, 100), spot5, 0.0, 0.5);

	}



 and this is the second script and that makes the second digit curl properly but all other digits stop working.

function Update () {

		animation.Play ("2nd_Digit");
	
}

thanks for the help
Jason

The problem originates from trying to play more than one separate animation at a time. See the animation manual page (especially the part about additive animation) to see how to fix this.

thanks… but how can I do it so all animations can run side by side not affecting each other? Just using AnimationBlendMode.Additive on the same layer?

SO I tried adding the aniamtion additive, but it made things much worst, very sporadic results.

All the animations are added to the same gameobject, is there a way to split the mesh into different gameobjects and add the animation to each one so it’s one animation per gam object?

If each finger is a separate animation, then you will need to have each on a separate layer and use additive animation to play them all together. Another option may be to define an extra animation that moves all the fingers at once.

Meow

Solved

When adding multiple animations to a gameobject, you add the first animation normaly, and all subsequnt animations are added using the .additives function

thanks