magique
Active member
Using Unity 2019.3.8f1 with the latest Third Person Controller. I followed the documentation with the following code:
However, when it runs, the SetActive function gets a null reference on the following code:
For m_GameObject.
The only thing I did different is that I'm not calling the SetPositionAndRotation portion because I just want to deactivate the character.
C#:
/// <summary>
/// Set the position and deactivate the character.
/// </summary>
private void Start()
{
var characterLocomotion = m_Character.GetComponent<UltimateCharacterLocomotion>();
if (characterLocomotion != null) {
characterLocomotion.SetPositionAndRotation(Vector3.zero, Quaternion.identity);
characterLocomotion.SetActive(false);
}
}
However, when it runs, the SetActive function gets a null reference on the following code:
Code:
m_GameObject.SetActive(active);
For m_GameObject.
The only thing I did different is that I'm not calling the SetPositionAndRotation portion because I just want to deactivate the character.