You probably don’t want to do that. The literal thing you’ve described is called a ‘local method’, (one function inside another) but you probably want to pass information from one method to another instead, or use a different Trigger method, like OnTriggerStay(Collider other). OnTriggerStay is called every frame that the other collider stays inside the trigger. Local functions are an advanced programming topic, but see little use in Unity.
Edit: to get better advice, try describing what you want to accomplish. “Put a void method inside another one” sounds like an attempt at a solution to a problem, so what is the actual thing you want to have happen?
Sure, the most common way is to pass information from one method to another is to use an “instance variable”. This is a variable that belongs to the script itself, not to a particular method.
public class ExampleScript : MonoBehaviour
{
private float myFloat = 0; // This variable lives outside of any method, and can be seen from any method in this script
private void Update()
{
if(myFloat > 2) // We are accessing 'myFloat', which isn't declared in this method, but we can still use it!
{
Debug.Log("MyFloat was bigger than 2!");
myFloat = 0;
}
}
private void OnTriggerEnter(Collider other)
{
if(other.gameObject.tag.CompareTag("Dano"))
{
// You can do your own logic here, but I'm going to do something simple for the sake of the example
myFloat += 1; // Again, using the myFloat variable from the script, just adding some value to it
}
}
}