Search Unity

Brackeys tutorial Help

Discussion in 'Community Learning & Teaching' started by Simas01, Apr 26, 2022.

  1. Simas01

    Simas01

    Joined:
    Oct 10, 2020
    Posts:
    14
    Hi! i've been trying to get into game development and am currently making a game by following several aspects of brackey's rpg tutorials, i'm working on the combat and he showed a specific script which i copied exactly as is (except for the name of the script)
    and its giving me an issue that i don't know how to fix:

    the script:

    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4.  
    5. public class EnemyAttack : Interactable
    6. {
    7.    public override void Interact()
    8.    {
    9.        base.Interact();
    10.      
    11.    }
    12. }

    the problems


    Assets\script\Controllers\EnemyAttack.cs(7,23): error CS0115: 'EnemyAttack.Interact()': no suitable method found to override

    it could also be that the tutorial is outdated by now since it came out in 2017, in any case any and all help is greatly appreciated
     
  2. Harsh-NJ

    Harsh-NJ

    Joined:
    May 1, 2020
    Posts:
    315
    Rather then cross-cheeking, I would not suggest you to directly copy-and-paste the code without understanding it first!

    And this issue is because of not understanding (if I'm am correct)

    It is saying that your are overriding the method "Interact" in the class "EnemyAttack", which inherits from the class "Interactable".. (this is what you are doing)

    But it says that no suitable method found to override... which surely means that you don't have the method "Interact" in your "Interactable" class!

    Hope it helps
     
  3. Simas01

    Simas01

    Joined:
    Oct 10, 2020
    Posts:
    14
    it did thanks!
     
    Harsh-NJ likes this.
  4. Jaxonf

    Jaxonf

    Joined:
    Dec 5, 2022
    Posts:
    1
    I need help with movment code C#