Turn Animation Float on and off with same trigger.

I’m creating a code that will triggering a animation float when collided, but I want to code it to where it also turns off the float/animation when hit by the same trigger var TiltingL = TiltL ? player.camera.camAnim.SetBool("TiltL", true) : player.camera.camAnim.SetBool("TiltL", false);

I want to use the “? :” code, but is unsure how to properly code it with the animation.

My question was answered, but if anyone else has the same question, here is the solution. Credit goes to
wenbingeng-MSFT.

player.camera.camAnim.SetBool("TiltL", player.camera.camAnim.GetBool("TiltL") ? false : true);