Question by
sid4 · Nov 09, 2016 at 04:56 PM ·
random.range
EASY. Make random loop time. ?
trying to make object loop randomly anywhere form .01 seconds to 2 seconds that's it random each time.
I have it working but its timed at same time loop I found random.range is needed but cant figure how to apply random.range
using UnityEngine;
using System.Collections;
public class MoveSample : MonoBehaviour
{
//Timer = Time.time + Random.Range(1,6);
void Start(){
iTween.MoveBy(gameObject, iTween.Hash("x", 3, "easeType", "easeInOutExpo", "loopType", "pingPong", "delay", .Random.Range(1,6)));
}
}
Comment
Answer by doublemax · Nov 09, 2016 at 05:24 PM
"delay" just makes the animation start after a delay, it doesn't affect the speed of the animation. For that you need to set the "time" parameter.
Your answer
Follow this Question
Related Questions
Random.Range not working? 2 Answers
Generate Random Numbers a Distance Apart From Each Other 1 Answer
How do I get random answers? 2 Answers
Problem with random Range, returns always same number 3 Answers