sid4
1
I am using a script from " itween " to move this gameobject up and down etc
but its not moving at the speed I want
2d game
I understand this script is probably linked and pulls from other itween scripts, I tried opening the other itween script but cannot figure how to adjust this, I tried adjusting some easin out etc code in the other itween script but still – nothing
please help
below is the script I have on the object –
if needed I can post the other itween script but its not possible its massively long
public class cutterupdown : MonoBehaviour
{
//Timer = Time.time + Random.Range(1,6);
/*
void Start(){
iTween.MoveBy(gameObject, iTween.Hash("x", 3, "easeType", "easeInOutExpo", "loopType", "pingPong", "delay", .3));
}
}
float maxTimeVis = 5.0f; //max time for visible
float maxTimeInvis = .5f; //max time for invisible
IEnumerator Start () {
float maxTimeVis = 5.0f; //max time for visible
float maxTimeInvis = .05f; //max time for invisible
float curTime = 0.0f;
while(Active) {
if (gameObject.GetComponent<Renderer>().enabled) {
curTime = Random.Range(0.01f, maxTimeInvis);
} else {
curTime = Random.Range(0.01f, maxTimeVis);
}
gameObject.GetComponent<Renderer>().enabled = !gameObject.GetComponent<Renderer>().enabled;
yield return new WaitForSeconds(curTime);
}
*/
void Start(){
iTween.MoveBy(gameObject, iTween.Hash("x", 3, "easeType", "easeInOutExpo", "loopType", "pingPong", "delay", Random.Range(.01f,1f)));
}
}
I think i already answered a similar question from you: The “delay” parameter controls “when” the animation starts, not the speed. Set the “time” parameter to control the speed of the animation.