FMOD.Studio.EventInstance.setPitch C# (CSharp) Method

setPitch() public method

public setPitch ( float pitch ) : RESULT
pitch float
return RESULT
        public RESULT setPitch(float pitch)
        {
            return FMOD_Studio_EventInstance_SetPitch(rawPtr, pitch);
        }
        public RESULT get3DAttributes(out ATTRIBUTES_3D attributes)

Usage Example

    void FixedUpdate()
    {
        tempTime += Time.deltaTime;

        FootSound.set3DAttributes(FMODUnity.RuntimeUtils.To3DAttributes(gameObject));

        PlayerLook();
        PlayerMoveing();
        Jump();

        if (Input.GetAxis("Vertical") >= 0.01f || Input.GetAxis("Horizontal") >= 0.01f || Input.GetAxis("Vertical") <= -0.01f || Input.GetAxis("Horizontal") <= -0.01f)
        {
            if (rg.isGrounded == true)
            {
                isMoving = true;
            }
            else if (rg.isGrounded == false)
            {
                isMoving = false;
            }
        }
        else if (Input.GetAxis("Vertical") == 0 || Input.GetAxis("Horizontal") == 0)
        {
            isMoving = false;
        }

        if (Input.GetButton("Fire3"))
        {
            if (tempTime >= 0.4f)
            {
                tempTime -= 0.4f;
                FootPlay();
            }
        }

        if (tempTime >= 0.6f)
        {
            tempTime -= 0.6f;
            FootPlay();
        }

        if (isJumping && rg.isGrounded)
        {
            FootSound.setPitch(2);
            FootSound.start();
            isJumping = false;
            FootSound.setPitch(1);
        }
    }
All Usage Examples Of FMOD.Studio.EventInstance::setPitch
EventInstance