Third Person Controller

Hi,
Actually we use the standard assets Third Person Controller. Do you @ben think about or planing to made a own custom character controller?

1 Like

Consider me interested in this idea too!

Bellow is a script I made to replace the 3rd person script. It is not as smooth but I wanted to start using my own animations. It rotates smoothly, moves to click, and doesnt look too bad. Its a start if you are interested.

 using UnityEngine;
 [RequireComponent(typeof(Rigidbody))]
 [RequireComponent(typeof(Animator))]
 public class PlayerController : MonoBehaviour
 {

Rigidbody mRigidbody;
Animator mAnimator;
Vector3 moveTarget;
bool walkAnim = false;
[SerializeField] float moveSpeed = 10f;
[SerializeField] float turnSpeed = 8f;

private void Start()
{
mRigidbody = GetComponent();
mAnimator = GetComponent();
mAnimator.speed = 1.5f;
mRigidbody.constraints = RigidbodyConstraints.FreezeRotationX | RigidbodyConstraints.FreezeRotationY | RigidbodyConstraints.FreezeRotationZ;
}

public void Move(Vector3 move)
{
if (move != Vector3.zero)
{
// Change animation from Idle to Walking, need a “Walk” state in Animations
if (!walkAnim)
{
mAnimator.CrossFade(“Walk”, .1f);
walkAnim = true;
}
// Move character
transform.position = Vector3.MoveTowards(transform.position, move, Time.deltaTime * moveSpeed);

  	// Rotate Character
  	var heading = move - transform.position;
  	Quaternion targetRotation = Quaternion.LookRotation(new Vector3(heading.x, 0, heading.z));
  	transform.rotation = Quaternion.Slerp(transform.rotation, targetRotation, Time.deltaTime * turnSpeed);
  }
  else
  {
  	// Change animation from Walking to Idle, need a "Wait" state in Animations
  	if (walkAnim)
  	{
  		mAnimator.CrossFade("Wait", .1f);
  		walkAnim = false;
  	}
  }

}
}

Thanks mate, but before i started this RPG course i made my own ThirdPersonConroller / Mecanim . But i hoped that we made an own one.

I’ve made mine too… but the main problem is how player attack 'cause it use click to move system which is not compatible with mine. :confounded:

Hey guys, so we will be working into the character controller more as we want to add the same functionality to the enemy and player. I just need to stay focused on adding new functionality in the right priority order.

2 Likes

Privacy & Terms