- Home /
I got some errors with GetComponent
In my code I'm getting errors with:
myPlayerGO.GetComponent <FPSInputController>().enabled = true;
myPlayerGO.GetComponent <CharacterMotor>().enabled = true;
It shows FPSInputController and CharacterMotor as errors. It says that they don't exist in context. How can I fix this?
Answer by Mmmpies · Dec 07, 2014 at 09:10 PM
When you highlight the myPlayerGO object and look in the inspector does it have a Component FPSInputController and CharacterMotor?
If not you need to click Add Component and add those items.
There both there. Every other script works, but these too.
Are these java scripts and you're running in C#? If so then you need to place them in one of the early phase folders as per...
Your answer
Follow this Question
Related Questions
Error after converting Jscript to C# 1 Answer
error CS0131: The left-hand side of an assignment must be a variable, a property or an indexer 3 Answers
BCE0019: 'enabled' is not a member of 'UnityEngine.Component'. 4 Answers
How to init disabled canvas properly 1 Answer
How to use if statement with var? 3 Answers