
It looks like you're new here. If you want to get involved, click one of these buttons!
Does anyone know how to add jumping to brackeys 3rd person movement tutorial
~
using UnityEngine;
class JumpThePlayer : MonoBehaviour
{
[SerializeField] private float JumpHeight = 15f; //Serialize field is used so that you can edit this private variable in inspector
[SerializeField] private float JumpSpeed = 2f;
CharacterController controller;
void Start()
{
controller = GetComponent<CharacterController>();
}
void Update()
{
Jump();
}
void Jump()
{
controller.Move(0f, JumpHeight * JumpSpeed * Time.deltaTime, 0f);
}
}
~