Colliders won't disable

EDIT: Now that some uneducated folk ruled me out, I am going to edit this post.

Problem: Okay, the problem is shown in the title. Basically, I’m working on this game and nothing works. Well, movement does but colliders disabling doesn’t.

I’ve tried to fix this problem, and even used the Unity Bug Report system to help (I obviously haven’t been on Unity for very long, and I think people should stop being rude and stupid af and embrace that). However, all the Unity team did was file it as an incident.

I’m not calling the Unity Team stupid or anything, or useless because they never helped, because I know that they have their own problems to deal with. So I’m requesting help from you guys.

Basically, here’s all the code. I’ll try to explain it without adding comments and making this look like a garbled mess.

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

public class WallWithHole : MonoBehaviour
{
    public GameObject WallWithHoleTile;
    public GameObject Player;

    int PlayerLayer;
    public int WallWithHoleLayer;
  

    private void OnCollisionEnter2D(Collider2D collision)
    {
        if (collision.tag == "Player")
        {
            PlayerLayer = Player.GetComponent<PlayerMovement>().Layer;

            if (WallWithHoleLayer == PlayerLayer)
            {
                WallWithHoleTile.SetActive(true);
            }
            else
            {
                WallWithHoleTile.SetActive(false);
            }
        }
    }
}

Firstly, there are two GameObjects. One which is the Player, and another one which is the WallWithHoleTile’s collider.

In the private void section where the WallWithHole Tile checks if the player is touching the tile or not, the WallWithHoleTile checks for the player’s Layer number. The Player has a function which returns its own Layer number.

It is supposed to detect where the player is via the Layer number.

However, when the Player’s Layer number and the WallWithHoleTile’s Layer number are equal, nothing happens.

Again, I can’t fix this. So I’m requesting help. Also if you want the files, I could give it to you so you can analyze the code deeper. This is a bit vague.

(Also geez, the users on this Forum are kind of rude af and toxic as hell.)

No one’s going to download a file from a google drive.

Post the code here in Code Tags.

2 Likes

That’s not how it works. That’s called a ZERO EFFORT POST to be more precise. Go review the forum rules for more details.

How to report your problem productively in the Unity3D forums:

http://plbm.com/?p=220

This is a bare minimum of information to report:

  • what you want
  • what you tried
  • what you expected to happen
  • what actually happened, especially any errors you see

If you post a code snippet, ALWAYS USE CODE TAGS:

How to use code tags: https://discussions.unity.com/t/481379

You may edit your post above.

EDIT: Wow, looking at your post history, you haven’t improved yourself much in a year, have you? I refer specifically to this disaster sequence here:

https://forum.unity.com/threads/i-need-an-answer-fast-what-the-heck-is-my-error.1132726/#post-7278691

8226591--1074615--Screen Shot 2022-06-22 at 9.02.20 PM.png

1 Like

Uh, okay.

Read and follow the rules. Create threads (and titles) that people can actually help you with. Don’t just post your project and say “Halp! Fix!”. Contributors here are knowledgeable and always will to help, especially when users are polite, and properly communicate. Fine folks are not your staff or underlings in any way.
Closed for low/effort and rudeness.
If you chose to post again, please read the rules, be polite and do the effort required.

1 Like