Third person movement

Hi there,

I’m currently make a third person multiplayer game in unity, and i’m kind of struggling to get nice third person movement
and i have tried everything but just didn’t fell right, or work right. So if anyone could maybe help me with some idea’s of what i could do or check out. And also this doesn’t really feel right for me only because i’m also trying to and in some animations.

First, you have to be more specific about what’s not “feeling or working right”.

Second, off the top of my head, you need a character controller and a following camera. There are tons of premade free assets in the Asset store for this and YouTube tutorials. It sounds like you’re a beginner so you should go through some of the Unity Learn content that’s now free to ensure you have a grasp on the engine and workflow first.

1 Like

Okay, thank you DrodifyDevs, will try and find some permade assets on the asset store and see what I find. And also for the camera follow I have gotten that to work right so the only thing i’m trying to get around is the player movement :slight_smile:

Oh, and also what i meant about it not feeling right was that , when ever you would move forward and stop it would like loop for a extra 4 sec. And if the character was not on a surface the character controller would just carry it over, even though there was no where to step. I have fixed it a couple times but now it seem’s that it’s not going away:(

Btw i’m using unity version 2019.4

Hi there,

I’ve found a good tutorial on third person movement but i’m getting a error saying, Vector2 does not contain a definition for ‘GetKey’. Here is the code

using UnityEngine;
using System.Collections;

public class PlayerController : MonoBehaviour {

public float walkSpeed = 2;
public float runSpeed = 6;

Animator animator;

void Start() {
animator = GetComponent();
}

void Update() {

Vector2 input = new Vector2(Input.GetAxisRaw(“Horizontal”), Input.GetAxisRaw( “Vertical”));
Vector2 inputDir = input.normalized;

if(inputDir != Vector2.zero){
transform.eulerAngles = Vector3.up * Mathf.Atan2(inputDir.x, inputDir.y) * Mathf.Rad2Deg;
}

bool running = input.GetKey(KeyCode.LeftShift);
float speed = ((running) ? runSpeed : walkSpeed) * *inputDir.magnitude;

transform.Translate(transform.forward * speed * Time.deltaTime, Space.World);

float animationSpeedPercent = ((running) ? 1 : .5) * inputDir.magnitude;
animator.SetFloat(“SpeedPercent”, animationSpeedPercent);
}
}