error CS1061: 'Collider' does not contain a definition for 'ComapareTag' and no accessible extension method 'ComapareTag' accepting a first argument of type 'Collider' could be found (are you missing a using directive or an assembly reference?)
код:
1using System;
2using System.Collections;
3using System.Collections.Generic;
4using UnityEngine;
5using UnityEngine.SceneManagement;
6
7public class Player : MonoBehaviour
8{
9 [SerializeField] KeyCode keyOne;
10 [SerializeField] KeyCode keyTwo;
11 [SerializeField] Vector3 moveDirection;
12
13 private void FixedUpdate()
14 {
15 if (Input.GetKey(keyOne))
16 {
17 GetComponent<Rigidbody>().velocity += moveDirection;
18 }
19 if (Input.GetKey(keyTwo))
20 {
21 GetComponent<Rigidbody>().velocity -= moveDirection;
22 }
23 }
24 private void OnTriggerEnter(Collider other)
25 {
26 if(this.CompareTag("Player") && other.ComapareTag("Finish"))
27 {
28 SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex + 1);
29 }
30 }
31}