problem cs1525 ??

using UnityEngine;
using System.Collections;

public class IA : MonoBehaviour {

	// Use this for initialization
	void Start () {
	
	}
	
	// Update is called once per frame
	void Update () {
		var Player = other;
		var Script = Animale;
		
		function OnTriggerEnter(other: Collider);
		{
			if(other.collider.tag == Player.tag)
			{
				Script = GetComponent(Animale); 
				Script.enabled = true;
			}
		}
	
	}
}

You’ve got a lot of problems going on here. Your syntax seems to be a mix of Javascript and C#.

The specific error you’re getting is because you declare a function inside of update, but even if you fixed that a lot would be wrong.

For starters

 var Player = other;
 var Script = Animale;

will also throw errors because other isn’t defined and Animale is a type and you can’t assign a type to a variable.

I think perhaps you’re trying to do something like this:

public class IA : MonoBehaviour {
    
    public Player player;
    
    private Animale otherScript;
    
    // Use this for initialization
    void Start () {
 
    }
 
    void OnTriggerEnter( Collider other)
    {
         if(other.collider.tag == player.tag)
         {
          otherScript = GetComponent<Animale>(); 
          otherScript.enabled = true;
         }
    
    }

#However, this may fix your problem but I’d HIGHLY suggest spending some time doing tutorials to learn C# a little bit better
Here’s a post with a bunch of great tutorials

Hey bud, it looks a little complicated as your code infers you have another class called Player and a further class called Script involved.
Could it be that you want the trigger to fire off when the GameObject that this script is attached to is triggered by another colliding object?

if so…

using UnityEngine;
using System.Collections;
 
public class IA : MonoBehaviour {
 
// Use this for initialization
void Start () {
 
}
 
// Update is called once per frame
void Update () {
//var Player = other;
//var Script = Animale; //the "Script" part of your declaration might be wrong too:

C#:
private Animale script;

void Start()
{
script = GetComponent();
script.enabled = false;
}

void OnTriggerEnter(other: Collider);
{
if(other.collider.tag == "Player") //TAG your player object in inspector
{
script.enabled = true;
}
}
 
}
}

So, with this replacement, you would need to go to your Player GameObejct and in it`s inpsector, fing the “Tag” dropdown box and select the “Player” tag .
Thsi will set you up for the trigger above.

Also, make sure your triggering collider is set to “isTrigger” in it`s inspector also.
Take crae bud, hope it helps some.
Gruffy

Thanks for the help, I just started with programming so I do not know much yet.
but I have another problem.
Now I get this error

The type or namespace name `MonoBehaviour 'Could not be found. Are you missing a using directive or an assembly reference?

public class IA : MonoBehaviour {

public Player player;

private Animale otherScript;

// Use this for initialization
void Start () {
	
}

void OnTriggerEnter( Collider other)
{
	if(other.collider.tag == player.tag)
	{
		otherScript = GetComponent<Animale>(); 
		otherScript.enabled = true;
	}
}

}