I imported Starter Assets - First Person Character Controller to my project. In game with my PressKeyReadLetter.cs script, when I click “E”, I want the player to stop moving. In another script, when I click “I”, my inventory pops up but player keeps moving. When I use my mouse, both cursor moves on inventory screen and player camera rotates. I don’t want it to happen. I tried to use:
GameObject.Find("Player").GetComponent<FirstPersonController>().enabled = false;
but I get an error in Unity :
“Assets\Scripts\PressKeyReadLetter.cs(47,56):
error CS0246: The type or namespace
name ‘FirstPersonController’ could not
be found (are you missing a using
directive or an assembly reference?)”
How can I access the FirstPersonController.cs or what is the proper way to do it? All answers I found from before 2020, so I couldn’t find any recent way.