Cannot get script component while the game object has a refered script

i have a problem with GetComponent

the camera is child object of character object and the camera has a script “mouseHit”, it has setCanAttack() method.

When character collide with a waypoint trigget, the trigger must get script mouseHit from camera object to use setCanAttack() method but the thing happened that it get null object

i tried GetComponentInChildren(mouseHit) but no effective
i declared variable to keep camera gameObject, drag-drop into the trigger and try to access the script but no effective either.

how can i fix this?

ps. i write it in javaScript.

Try var mh : mouseHit = Camera.main.GetComponentInChildren(“mouseHit”)

BTW It is commonpractice to Captialize functions and classes (script names) and lower case the first letter of variables, to help keep them cognitively distinct.