Hey everyone!
I have a code sample here made in a test project I was doing, quickly testing stuff with physics and all that. I'm using VS2010, not using .NET. I am using Unity Engine (Of course!) and C# only in this sample.
Here it is:
using UnityEngine;
public class CharacterController : MonoBehaviour //<----- VERY VERY STUPID
{
public CharacterController controller;
// Use this for initialization
void Start ()
{
controller = GetComponent<CharacterController>();
}
// Update is called once per frame
void Update ()
{
float hor = Input.GetAxis("Horizontal");
float ver = Input.GetAxis("Vertical");
controller.Move(/*Vector3 info*/);
}
}
The problem is that the controller object has no Move method. I have the library, the acces modifier is not making any difference so just ignore if it's public private protected or internal for now. I am aware of the sloppy code (Null catching, local typing etc etc. Just ignore that for now please, just want to find why I can not see Move method in the controller)
The controller and script are both hooked to a player object with a rigidbody.
Need more info? Just ask
Thanks in advance
I know, the parameter is not relevant information. What I'm looking for was the move function that was part of the library, but from what I gather, is that there is none at all.
– anon90873654The move method is supposed to be part of the character controller according to the Unity3D example shown here. http://unity3d.com/support/documentation/ScriptReference/CharacterController.Move.html
– anon90873654Yes. And it is. But you are overwriting the CharacterController class. If you rename your class to CharacterController2 it will work.
– StephanK