Hi.
Can someone explain why the hazard is not moving? I am expecting that it will fall down with the velocity (0f, 0f, -20f), but it’s just rotating in one place. The problem is in the last 2 lines.
public GameObject hazard;
public Vector3 hazardPosition;
void Start () {
CreateWaves();
}
void CreateWaves () {
Quaternion hazardRotation = Quaternion.identity; // no rotation
Vector3 position = new Vector3(Random.Range(-hazardPosition.x, hazardPosition.x),hazardPosition.y,hazardPosition.z);
hazard.rigidbody.velocity = new Vector3(0f, 0f, -20f);
Instantiate (hazard, position, hazardRotation);
}