// Update is called once per frame
    void FixedUpdate()
    {
        // Apply force to the mover, with ForceMode.Impulse taking mass into account
        mover.body.AddForce(wind, ForceMode.Impulse);

        mover.CheckBoundaries();
    }
Beispiel #2
0
    // Update is called once per frame
    void FixedUpdate()
    {
        yAir += .1f;
        float   air  = yAir * Mathf.PerlinNoise(Time.time * .5f, 0.0f);
        Vector3 wind = new Vector3(0f, air, 0f);

        // Apply force to the mover, with ForceMode.Impulse taking mass into account
        mover.body.AddForce(wind, ForceMode.Impulse);

        mover.CheckBoundaries();
    }