In this Unity C# scripting tutorial, I show you guys how to make a simple crouch script in Unity.
For more Unity tutorials, be sure to like comment and subscribe for more! 👍
#unity3d #unity
The Script:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Crouch : MonoBehaviour
{
public CharacterController PlayerHeight;
public float normalHeight, crouchHeight;
void Update(){
if(Input.GetKeyDown(KeyCode.C)){
PlayerHeight.height = crouchHeight;
}
if(Input.GetKeyUp(KeyCode.C)){
PlayerHeight.height = normalHeight;
}
}
}
----------------------------------------------------------------------
Follow me on Twitter:
/ omogonix
Try out my games:
https://omogonixlachlan.itch.io
Forgehub:
https://www.forgehub.com/members/omog...
Subscribe to my Second Channel:
/ @lachlanshelton129
Join my Discord:
/ discord
Facebook Page:
/ omogonix
Follow me on Instagram:
/ uwugonixhalo
Watch video Simple Crouch Script in Unity Using C# - Unity Tutorial 2021 online without registration, duration hours minute second in high quality. This video was added by user Omogonix 18 October 2021, don't forget to share it with your friends and acquaintances, it has been viewed on our site 8,927 once and liked it 130 people.