system
1
I just made this script
var wind : float = 500.0;
function start () {
rigidbody.AddForce(Vector3(0,0,wind));
}
Easy…Now i want to add a function that will tell the start frunction to start every lets say 30 sec…
I dont know how to do this any ideas will be very apreciated
Meater6
2
Start function is called only when the game starts. You can either loop the AddForce infinity times and put in a "yield WaitForSeconds(30)". Or you can use update like this:
var wind : float = 500.0;
var lastWindTime : float = 0.0;
function Update () {
if(Time.time - lastWindTime > 30) { //of course you can always change the 30 sec
lastWindTime = Time.time;
rigidbody.AddForce(Vector3(0,0,wind));
}
}
Though this script is untested, it should work fine.