Hi, first post ever, I’ll try my best to make it comprehensible (I see after the fact that it is quite a long post, sorry…).
I’m a perfect newbee and after following some tutorials I thought that I could experiment and learn a bit by working on a small idea I had for my own amusement, while I use chatGPT to help me with syntax and proper actions (methods ?) to call.
I am trying to make a good old fashion point click style game (Monkey Island and all).
I have already made the very basics artworks that I need to test some first codes and functionalities.
Right now, my worflow is the following :
_I prepare on paper the idea of what I want to do
_I have everything set in Unity as I “think” it should be
_I start creating the basic of my scripts.
_Make a thing that work but find a problem that I don’t undestand
_Proceed to wish I have always been dead
So about the game itself :
I have made the basics of my very first scene/room and a first sprite of my main character, here it is :
You can already see that there is a camera (16/9) in a wide background, and little footprints on the ground.
Here is my hierarchy :

_“bedRoomBackground” is my background
_“bedRoomOverLayer” is the big dark grey pillar in the middle (it’s a wall separation)
_“colliderRight” and “colliderLeft” are the respective little footprints on the floor
_“Character” who has the sprite of the character and is a children of the “Character Pivot” (I use it for setting the anchor point of the character and the script for the position)
_“MainCamera” who is the camera, children of controllerCamera (I like to keep control of the children independently)
Inside “colliderRight/Left” and “Character” I have a Box Collider 2D, with the sizes and positions I want them to have :

Now The idea is :
Make a dolly shoot from one side of the room to the other. The dolly is activated by one click on one of the footprints and when the character enters the space where his collider and the collider of the footprints intersect each other.
So about the steps I think it should take :
0_By default the footprints are deactivated (to prevent the dolly movement to happen just if the character randomly walk on the collider)
1_I click on one of the desired footprints > activate the collider
2_The character goes where the click happens, making his collider overlaping with the footprints collider (he already has the proper code to go to where the click happens)
3_When both the collider are overlaping the camera movement starts and go to the other side of the room
Some exceptions:
Beeing able to reverse the camera movement in case of an error.
ex :If I click on the right collider by accident (activating the camera movement) and want to reverse it fast by clicking on the left collider or somewhere else (while the camera is still dollying), it should stops the movement and come back where it were.
So, right now, the code I want to make this happens is on one script who is on both of the colliderRight/Left. The idea is to have these colliders making the entire movement happens to their own opposite side.
I am at the first step : Click to activate the collider.
Here is the code I have right now :
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ControllerDollyCam : MonoBehaviour
{
//All the slots I need to link in Unity I can think of for now
public GameObject controllerCamera;
public BoxCollider2D character;
public BoxCollider2D colliderRight;
public BoxCollider2D colliderLeft;
public Vector3 positionDollyRight;
public Vector3 positionDollyLeft;
//Some private bool I wanted to use at first but chat gpt decided to change that (still there in case)
private bool activateRightCollider = false;
private bool activateLeftCollider = false;
//Activate one footprint collider and deactivate the other
private void OnMouseDown ()
{
Vector2 mousePosition = Camera.main.ScreenToWorldPoint(Input.mousePosition);
if (colliderRight && colliderRight.OverlapPoint(mousePosition))
{
//Activate the collider I click on
colliderRight.enabled = true;
Debug.Log("Right collider activated");
//Deactivate the other collider in case the character walk on it afterwards
colliderLeft.enabled = false;
Debug.Log("Left collider deactivated");
}
//Same but for the other collider
else if (colliderLeft && colliderLeft.OverlapPoint(mousePosition))
{
colliderRight.enabled = false;
Debug.Log("Right collider deactivated");
colliderLeft.enabled = true;
Debug.Log("Left collider activated");
}
}
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
}
}
Here is what it looks like in unity for one of the collider in the inspector :
The problem I have now :
When I click on one of the collider (no matter which one), I can see in the console that it is working properly, however if I click on the second collider afterwards, nothing happens.
My own commentary :
_I think it is because of the lines “colliderRight.enabled = false;” “colliderLeft.enabled = false;”. It sets their status as false and inactive indefinitely. I don’t know how to implement this correctly.
_I think I should use a “switch { case }” instead of an “if{} else {}” but I am not sure
_I wanted to use the “private bool activeRight/leftCollider = false” to link to the proper colliders so I can switc hthem on/off, but chat GPT corrected it, is it a mistake or did i really didn’t needed it ?
There it is for now, should I rework it entirely or is it simpler than that ?
I hope it wasn’t too long and that everything is here.
Thanks for your reponses and good night (it is 11pm here)!

