Simple Crouch Script in Unity Using C# - Unity Tutorial 2021

Channel:
Subscribers:
12,600
Published on ● Video Link: https://www.youtube.com/watch?v=_sXdzEbU0A4



Category:
Tutorial
Duration: 4:03
7,268 views
113


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:
https://twitter.com/omogonix

Try out my games:
https://omogonixlachlan.itch.io

Forgehub:
https://www.forgehub.com/members/omogonix.87700/

Subscribe to my Second Channel:
https://www.youtube.com/channel/UCkylkvUtpvbHfafGfIdMLBQ/featured

Join my Discord:
https://discord.gg/a88vmGD

Facebook Page:
https://www.facebook.com/Omogonix/

Follow me on Instagram:
https://www.instagram.com/uwugonixhalo/







Tags:
unity
unity3d
unity 2021
unity engine
unity tutorials
how to crouch in unity
unity c# tutorials
c#
c# tutorial
simple crouch script in unity
unity simple crouch script
omogonix
tutorial
how to
unity 2020
how to make a game
csharp
programming
coding
scripting
game design
game development
how to use c#
c# beginners
how to crouch