Exemple #1
0
    // Update is called once per frame
    void FixedUpdate()
    {
        if (!parallax.isReady)
        {
            return;
        }
        Vector3 target      = OrigPos + (parallax.DeltaDistance() * (parallax.speed / layerModifier));
        Vector3 curVelocity = Vector3.zero;

        OrigPos            = Vector3.SmoothDamp(OrigPos, target, ref curVelocity, 0.1f);
        transform.position = OrigPos;
    }