viewers access
public void Player.PlayerController.SetHeight(Vector3 vec)
CyberPsychosis > Player > PlayerController > SetHeight
Sets the target height of the character, will lerp to this height smoothly.
using UnityEngine;
using Player;
public class Crouching : MonoBehaviour
{
public PlayerController player;
public float crouchHeight = 0.8f;
void Update()
{
if(Input.GetKeyDown(KeyCode.LeftControl))
player.SetHeight(crouchHeight);
if(Input.GetKeyUp(KeyCode.LeftControl))
player.ResetHeight();
}
}