Hello, this code seems too long.
I used the if statement to check if it’s onMulti
or not the only difference is that if onMulti
is true
check if view.IsMine
but if onMulti
is false
then it won’t check if view.IsMine
is it possible to make it shorter?
if (onMulti == true)
{
if (view.IsMine)
{
if (stun == false)
{
if (context.performed && onGround)
{
animator.SetTrigger("takeOf");
rb.drag = linearDrag * 0.15f;
}
}
}
}
if (onMulti == false)
{
if (stun == false)
{
if (context.performed && onGround)
{
animator.SetTrigger("takeOf");
rb.drag = linearDrag * 0.15f;
}
}
}