- Home /
GetComponent help needed CSharp
hey everyone, GetComponent is somethign that i never realy understud and have decided to use send message instead(i truely dont knwo which one is better tho i believe its the GetCOmponenet) and right now i thought i might try and use it for the sake of learning. here is waht i got:
public nexus componentNexus;
void Start () {
componentNexus = GetComponent(nexus);
}
(its a long script so it messed up when i took out the parts that had nothing to do with this so you dont have to read much)
anyway a bunch of errors apear and i have tried everyting i could and nothing seems to work. pls some one help me. ty very much everyone
Answer by clunk47 · Nov 02, 2013 at 12:01 AM
C# Example of how to use GetComponent.
CharacterController controller;
void Start()
{
controller = GetComponent<CharacterController>();
controller.enabled = true;
}
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
C# GetComponent()... Not finding script problem. 1 Answer
pickup weapon with GetComponent 0 Answers
Multiplayer - controls get switched 0 Answers