YACC YACC
YACC YACC
Made with ❤️ for Unity

Search Results for

    Constructor GearBox

    GearBox(float[], float, float, float)

    Initializes a new instance of the GearBox class.

    Declaration
    public GearBox(float[] ratios, float final, float reverse = 3, float changeGearTime = 0.5)
    Parameters
    Type Name Description
    float[] ratios

    The gear ratios provided as an array of floats.

    float final

    The final ratio.

    float reverse

    The reverse ratio.

    float changeGearTime

    The change gear time.

    Examples

    You can initialize a gearbox for your custom controller, for example a 5-gear car like this:

    using YACC;
    
    public class MyCarEngineController : MonoBehaviour {
        private GearBox gearBox = new(
            new float[] { 2.66f, 1.78f, 1.30f, 1.00f, 0.74f }, // Gear Ratios
            4.10f, // Final drive ratio
            3.23f, // Reverse ratio
            0.5f   // Shift time
        );
    }
    © Deimos Industries Ltd. All rights reserved.