I’ve been converting some example projects I found from js to C#. I have two questions that perhaps someone can illuminate for me…
- I’m trying to convert the following lines to C#.
CharacterController controller = GetComponent(CharacterController);
controller.Move(moveDirection * Time.deltaTime);
When declaring it, I get the following errors:
" Expression denotes a type', where a
variable’, value' or
method group’ was expected". I thought CharacterController was a Component, and therefore the following would work.
Component controller = GetComponent("CharacterController");
But while it accepts that syntax, it complains that UnityEngine.Component doesn’t contain a definition for Move.
- Can anyone point me to Unity 3D C# code examples (I’ve seen the 3 or 4 that comes with the Standard Assets- but not much else on the interweb)? It’d be kind of like a “Rosetta stone” of sorts.