playMaker

Author Topic: Unity Compiler Errors - no suitable method found to override[SOLVED]  (Read 6768 times)

Sinc

  • Playmaker Newbie
  • *
  • Posts: 7
Hey people

I am currently working on my study project and I have 6 errors which I don't know how to fix. I am a beginner to coding so I am pretty lost. The errors are the following:

1. Assets\PlayMaker\Actions\Physics\CollisionEvent.cs(189,24): error CS0115: 'CollisionEvent.DoCollisionEnter(Collision)': no suitable method found to override

2. Assets\PlayMaker\Actions\Physics\CollisionEvent.cs(195,27): error CS0115: 'CollisionEvent.DoCollisionStay(Collision)': no suitable method found to override

3. Assets\PlayMaker\Actions\Physics\CollisionEvent.cs(201,27): error CS0115: 'CollisionEvent.DoCollisionExit(Collision)': no suitable method found to override

4. Assets\PlayMaker\Actions\StateMachine\RunFSMAction.cs(114,30): error CS0115: 'RunFSMAction.DoCollisionEnter(Collision)': no suitable method found to override

5. Assets\PlayMaker\Actions\StateMachine\RunFSMAction.cs(122,30): error CS0115: 'RunFSMAction.DoCollisionStay(Collision)': no suitable method found to override

6. Assets\PlayMaker\Actions\StateMachine\RunFSMAction.cs(130,30): error CS0115: 'RunFSMAction.DoCollisionExit(Collision)': no suitable method found to override

I already reinstalled Playmaker twice, it didn't work. I am midway into a project. I didn't really install any assets, at least not that I can think of.

Please help me so I can fix this problem and continue working. I appreciate all the support. Thanks in advance.

Kind Regards

Sinc
« Last Edit: December 02, 2019, 10:30:21 PM by djaydino »

Sinc

  • Playmaker Newbie
  • *
  • Posts: 7
Re: Unity Compiler Errors - no suitable method found to override
« Reply #1 on: December 01, 2019, 07:54:49 PM »
The code of the CollisionEvent has even a few more errors. I also check if I have any plugins installed: none.

Sinc

  • Playmaker Newbie
  • *
  • Posts: 7

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Unity Compiler Errors - no suitable method found to override
« Reply #3 on: December 01, 2019, 10:29:54 PM »
Hi.
Can you give some more information on how you build the project?

Which target platform
Which unity version
Which Playmaker version (find the Exact version @ Playmaker/Help/About Playmaker...)

Also are you building in cloud?
Are building from visual studio?
If 1 is thru, try a build directly in unity.

Sinc

  • Playmaker Newbie
  • *
  • Posts: 7
Re: Unity Compiler Errors - no suitable method found to override
« Reply #4 on: December 02, 2019, 10:19:48 AM »
Hi

I am using Unity 2.9f1 and my target platform is Windows. I downloaded Playmaker from he asset store, so it should be the latest version. I dont use the cloud and I did some coding for movement, animations, and collisions. Maybe the mistake is in one of these scripts? They work without issues though and they have no errors. Also some quite some time passed since I did the coding, so I kinda lost the overview... Is there any other information I can provide? Can also provide the project if there is no other way...

Thanks in advance.


Sinc

  • Playmaker Newbie
  • *
  • Posts: 7
Re: Unity Compiler Errors - no suitable method found to override
« Reply #5 on: December 02, 2019, 11:03:53 AM »
It seems like the problem is connected to my collision script. I removed it and the error was suddenly gone. Please check and help me to fix this today if possible:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Collision : MonoBehaviour
{

   
    public LayerMask groundLayer;



    public bool onGround;
    public bool onWall;
    public bool onRightWall;
    public bool onLeftWall;
    public int wallSide;

   

   

    public float collisionRadius = 0.25f;
    public Vector2 bottomOffset, rightOffset, leftOffset;
    private Color debugCollisionColor = Color.red;

    // Start is called before the first frame update
    void Start()
    {
       
    }

    // Update is called once per frame
    void Update()
    { 
        onGround = Physics2D.OverlapCircle((Vector2)transform.position + bottomOffset, collisionRadius, groundLayer);
        onWall = Physics2D.OverlapCircle((Vector2)transform.position + rightOffset, collisionRadius, groundLayer)
            || Physics2D.OverlapCircle((Vector2)transform.position + leftOffset, collisionRadius, groundLayer);

        onRightWall = Physics2D.OverlapCircle((Vector2)transform.position + rightOffset, collisionRadius, groundLayer);
        onLeftWall = Physics2D.OverlapCircle((Vector2)transform.position + leftOffset, collisionRadius, groundLayer);

        wallSide = onRightWall ? -1 : 1;
    }

    void OnDrawGizmos()
    {
        Gizmos.color = Color.red;

        var positions = new Vector2[] { bottomOffset, rightOffset, leftOffset };

        Gizmos.DrawWireSphere((Vector2)transform.position  + bottomOffset, collisionRadius);
        Gizmos.DrawWireSphere((Vector2)transform.position + rightOffset, collisionRadius);
        Gizmos.DrawWireSphere((Vector2)transform.position + leftOffset, collisionRadius);
    }
}

I appreciate all the support!

Sinc

  • Playmaker Newbie
  • *
  • Posts: 7
Re: Unity Compiler Errors - no suitable method found to override
« Reply #6 on: December 02, 2019, 01:54:21 PM »
FIXED IT!!!

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Unity Compiler Errors - no suitable method found to override[SOLVED]
« Reply #7 on: December 03, 2019, 03:50:23 AM »
Hi,

 what was it?

Bye,

 Jean

Sinc

  • Playmaker Newbie
  • *
  • Posts: 7
Re: Unity Compiler Errors - no suitable method found to override[SOLVED]
« Reply #8 on: December 03, 2019, 04:33:45 AM »
Well, I had a script which I used for the collisions, to check whether the player is touching the right, left or bottom. I named the script "Collisions". This actually caused the 6 errors and nowhere the script was mentioned. So I didn't notice that its connected to the collision script. I fixed it by just changing the name of the script to "CollisionDetector". Kind of stupid bug, maybe only happens to beginners...


Sinc

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Unity Compiler Errors - no suitable method found to override[SOLVED]
« Reply #9 on: December 04, 2019, 12:49:43 AM »
Hi,

 if only... :) it happened to everyone and if someone says otherwise, he's lying ... :)

Bye,

 Jean