Conditional Operator for an Animator Set Float

What is another way you can recode a Conditional Operator in an if else statement or any other way?

Vector3 relativeMoveVector = Quaternion.AngleAxis(cameraRig.eulerAngles.y, Vector3.up) * moveVector;

characterController.Move(relativeMoveVector);

animator.SetFloat(“Speed”, relativeMoveVector == Vector3.zero ? 0f : (isRunning ? 1f : .5f), animSpeed, Time.deltaTime);
if (relativeMoveVector != Vector3.zero)
Rotate(relativeMoveVector);

First, if you post a code snippet, ALWAYS USE CODE TAGS:

How to use code tags: Using code tags properly

You may edit your post above.

Second, don’t compare floating point values (or vectors of floating point values) for equality. Here’s why:

https://starmanta.gitbooks.io/unitytipsredux/content/floating-point.html