void setOffset() { rand = Random.Range(-2.0f, 2.0f); Mathf.Round(rand); randDeci = Random.Range(-0.2f, 0.2f); offset = muzzle.getOffset(); if (offset.x < rand) { muzzle.setOffset(new Vector3(offset.x - rand - randDeci, offset.y)); } else if (offset.x > 0.5f) { muzzle.setOffset(new Vector3(offset.x + rand + randDeci, offset.y)); } Debug.Log(offset); }
void resetOffset() { muzzle.setOffset(transform.position); }