Basic Third Person Character Controller in Unity - Unity C# Tutorial 2022

preview_player
Показать описание
In this Unity tutorial, I teach you guys how to make a basic third person character controller in Unity using the C# programming language. This character controller allows you to jog (forward and back), sprint, and rotate around for basic player movement. I also show a few easy camera methods as well.

#Unity #Unity3D

For more Unity tutorials or more videos in general - be sure to like, comment, and subscribe for more! 👍

Check out my other tutorials:

Follow me on Twitter:

Try out my games:

Forgehub:

Subscribe to my Second Channel:

Join my Discord:

Facebook Page:

Follow me on Instagram:

Music Used:
Licensed under Creative Commons: By Attribution 4.0 License

Licensed under Creative Commons: By Attribution 4.0 License
Рекомендации по теме
Комментарии
Автор

Player Script:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class player : MonoBehaviour
{
public Animator playerAnim;
public Rigidbody playerRigid;
public float w_speed, wb_speed, olw_speed, rn_speed, ro_speed;
public bool walking;
public Transform playerTrans;


void FixedUpdate(){

playerRigid.velocity = transform.forward * w_speed * Time.deltaTime;
}

playerRigid.velocity = -transform.forward * wb_speed * Time.deltaTime;
}
}
void Update(){



walking = true;
//steps1.SetActive(true);
}



walking = false;

}



//steps1.SetActive(true);
}




}

playerTrans.Rotate(0, -ro_speed * Time.deltaTime, 0);
}

playerTrans.Rotate(0, ro_speed * Time.deltaTime, 0);
}
if(walking == true){



w_speed = w_speed + rn_speed;


}



w_speed = olw_speed;


}
}
}
}

Camera Script:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class camLookat : MonoBehaviour
{
public Transform player, cameraTrans;

void Update(){

}
}

Omogonix
Автор

Good straightforward tutorial man. THank goodness. Also uploading the script in a comment like a champ!

GoobNoob
Автор

I just started leaning Unity and I did understand everything. Thanxxx

nucearant
Автор

Man, I really appreciate the time and effort you put into this video. I can't thank you enough for what you did.

FarmBoyTech
Автор

Just made my first 3d animated character thanks to this video, there are some improvements to make but this will do for now.

abdulakhkurbanov
Автор

Thanks to you I succeeded to animate and control my Character🙂

MikaelL
Автор

At 10:53 in the video when discussing the sprinting, I use "=!" As an "equal to" symbol when in reverse it actually means "doesn't equal to", I should've used "==", just wanted to correct myself there lol. This mistake has nothing to do with the code, just the text in the video I was using to explain what to do.

Omogonix
Автор

This was the most helpful video I ever watch🤩, Thank you so much!

Black_Jay_LBS
Автор

Thank you very much for your tutorial with which I learned better about animations in Unity.

EmporioRemix
Автор

Hated the cinemachine Controller, It was weird. Thanks for your tutorial

BlinkersGameDev
Автор

my character is not stopping. Please tell me the solution for this and also my character in moving on plane surface but on terrain (i mean on little bit distorted surface ) it is not walking properly

mamtapatil
Автор

This Helped me alot, but is there any alternative for update function?

abdullabutt
Автор

i have a question, when i press W or S my player run forward or backwards and thats good but when i release one of that keys my camera and player dont stop but keeps going forward or backwards in idle modus. Can you help me?

ProGamingg
Автор

sorry for the question, but how can i add animated jump? thank you.

rosariocascone
Автор

I know I am late, but I think making a halo fan game would be something really 👍

mk_
Автор

Can you please make an updated version with jump and non tank controls plz i cant figure it out

Yourtourguidetoearth
Автор

Hey, can you please tell me about how to add an animation that plays when you press a or d? I have set up the a and d movement and a different camera movement style, and I have a trigger for the animation in the controller, but when I reset Idle in the script and set the sideways animation it just does a tpose. I even connected the sideways animation with every other animation in the controller, please help!

SolaFideSolusChristus
Автор

Any ideas on how to rotate the camera? With the mouse?

laylaleaks
Автор

Hi! I implemented this in my own game but the character's collision with the terrain isn't working too good. Sometimes it gets stuck in it if it's trying to go upwards, then when i got down, it floats. What can I do to fix this?

miaiiiaiom
Автор

The animations make it so he only runs on the spot and is stay still, instead of running the whole thing. How do I fix please?

robro