Hey guys. I have a problem. I’m making a game were targets move from the side and you have to shoot them. I wrote a script to make them move on the x axis, but they move kind of diagonally. What’s wrong? here’s the script:
var moveSpeed = 5.0;
function Update () {
var x = Time.deltaTime * moveSpeed;
transform.Translate(x,0,0);
}
Also, I can make an object instantiate automatically but how can I control the timing at which they spawn?
Here’s my script:
[CODEvar farMovingTarget : Transform;
function Update () {
var createTarget = Instantiate(farMovingTarget, GameObject.Find(“farMovingTargetSpawn”).transform.position, Quaternion.identity);
}][/CODE]
Help on this would be appreciated. Thanks.