Hey guys! I’m coding my player’s crouching and my player is holding an object (which is a child). When he crouches the object looks smashed as the code works by changing the player’s Y scale. Is there any I can rearrange the hierarchy or the code, so the item doesn’t look funky?
// start crouch
if (Input.GetKeyDown(crouchKey))
{
transform.localScale = new Vector3(transform.localScale.x, crouchYScale, transform.localScale.z);
rb.AddForce(Vector3.down * 5f, ForceMode.Impulse);
}
// stop crouch
if (Input.GetKeyUp(crouchKey))
{
transform.localScale = new Vector3(transform.localScale.x, startYScale, transform.localScale.z);
}