I have a model (a Mixamo Fuse character, with animations), which has on it a Character Controller, a script, and which is a child of an empty game object. It does not have on it a Rigidbody of any kind. All my collision layers are set to collide with each other. My character is positioned 1 unit above a plane which has on it a mesh collider. And yet, when I press play, the character falls until half its body is embedded into the plane, then stops. I can move around normally, but remain inside the plane. Below is the script for reference. Unity version is 2019.3.0b12
using System;
using Rewired;
using UnityEngine;
public class Character : MonoBehaviour
{
public int playerID = 0;
public float moveSpeed = 5.0f;
public float jumpSpeed = 8.0f;
public float gravity = 20.0f;
private Player _player;
private CharacterController _cc;
private Vector3 _moveVector = Vector3.zero;
private bool _jump;
private void Awake()
{
_player = ReInput.players.GetPlayer(playerID);
_cc = GetComponent<CharacterController>();
}
private void Update()
{
GetInput();
ProcessInput();
}
private void GetInput()
{
_moveVector.x = _player.GetAxis(0);
_jump = _player.GetButtonDown(1);
}
private void ProcessInput()
{
if (_cc.isGrounded)
{
_moveVector = new Vector3(_moveVector.x, 0.0f, 0.0f);
_moveVector *= moveSpeed * Time.fixedDeltaTime;
if (_jump)
{
_moveVector.y = jumpSpeed;
}
}
_moveVector.y -= gravity * Time.fixedDeltaTime;
_cc.Move(_moveVector * Time.fixedDeltaTime);
}
}