Simple help please? c# scripting

hey I’m making a game, and so I have a script that requires the variable “fps target” to be assigned.
problem is, I want to assign the fps target only when something happens. (for instance, if a gameobject with the tag “Enemy” is in radius, then assign that gameobject at the “fps target” variable).

and where can I also learn more about C# scripting?

TY xD

For “when something happens” you probably need to put your assignment code into OnTriggerEnter, where you’re using a Sphere collider as trigger for an enemy to walk into.

And there’s this official tutorial page about C# from Unity:

Ok thanks a lot bro!