Question by
Lyzix · Aug 18, 2016 at 07:19 PM ·
c# tutorialcrouchfps tutorial
Crouch fps tutorial or help in C#
Hello guys, i'm trying to make my character crouch in my fps, but when i press left control my character is going into the grand and running as hell but not moving. Here is my script if someone can help me it would be very appreciated :
using UnityEngine; using System.Collections;
public class Crouching : MonoBehaviour {
// Use this for initialization
void Start ()
{
}
// Update is called once per frame
void Update ()
{
if (Input.GetKey(KeyCode.LeftControl))
{
transform.position = new Vector3 (2.53f, 0.5f, 1.2f);
}
else
{
transform.position = new Vector3(2.53f, 1.042f, 1.2f);
}
}
}
Good evening guys
Comment
Your answer
Follow this Question
Related Questions
Unity 2D - Need Help Staying Crouched while Under Something 0 Answers
3D Space Shooter C# tutorial 1 Answer
Same code but code not working ? 0 Answers
Camera Follow position reset,Camera Follow Position is wrong 0 Answers
not working code(help) I want it to randomly spawn my prefabs continuously ( I have 4 of them) 1 Answer