Good Evening. After several attempts and following some tutorials, I’m still confused about this problem, even though I have a better understanding of what it is.
This type of camera has several names, including: room scope camera, room transition camera, Zelda-like camera, or [2D] fixed-position camera.
I’ve watched several tutorials and even tried some things on my own with the little knowledge I have, but it hasn’t worked very well. Maybe it’s a bit of a “skill issue” or something like that. I always end up confused or the code crashes after I mess around with it a little more. I haven’t had much success with this, so I would really appreciate some help. Whether it’s a tutorial link or a comment on the topic, I’m open to anything.
I really don’t want to give up on this camera, but if it’s the only option, I guess I don’t have much choice. Thank you for reading this far, and to everyone who has helped me before and so far. Any further help is appreciated.
Hello, is there a specific thing you need help on? Do you have any code that you’ve written so far? I could make a simple demo for you if you think that you could learn from the code.
ᅠ
This is the best I could do, following this tutorial. Apparently, using collisions in this way is more complicated than “camera bounds.” Some research leads me to believe that there may be a more effective method, but I’m not sure about that.
This one worked pretty well, for a while. But suddenly, it stopped working, and I don’t know why. I think it’s some sort of corrupted file, though. But wait a minute, I’ve found something interesting.
I found a file on an old flash drive. I had tried something similar last year, when I was still planning to make a FAITH fangame. Following this tutorial, I extended the “doors” to the four corners, and I was able to achieve an interesting result, even though the limits didn’t fit well and not all directions worked. I changed a bit of the code, but overall I followed the project almost to the letter.
ᅠ
Taking some of the files of the old project to a new one, I got this error message:
Invalid set index ‘accept_input’ (on base: ‘null instance’) with value of type ‘bool’
Okay if it’s some kind of corrupted file, do you get any errors? Or would you rather I help with restarting the code from scratch instead of troubleshooting the current one?
I believe it will take less time to troubleshoot and debug the issue properly. Of course, I don’t want to take advantage of your goodwill in any way! The main problem here is that the code doesn’t seem to be responding to contact/collision. The only thing I have are these messages. It seems like there’s one for each collision, but I don’t know where the other two at the top come from:
Hi, those are warnings and should not affect the functionality of the game. Can you set a breakpoint (click the gutter to the right of the script to set a breakpoint, a red dot should appear) or a print statement to see if the collision functions are being called?
a physics layer is something that a physics object exists on. player is assigned to layer 3, so it exists on layer 3. meanwhile, masks mean that the object is looking for other objects that have that layer. so the camera is looking for objects on layer 2, and so cannot find the player because it is on layer 3. you need to change the mask to 3.
also the script of the camera sets the camera’s position to the player’s position at the start, if you don’t want that then you need to change where it is placed in the ready function
Thank you very much. Well, despite everything, it still doesn’t seem to be colliding. I set breakpoints in the functions to check, but nothing appeared in the console. Maybe using the “print” method could provide some answers?
The object did not respond in any direction except for the right. I received 400+ error messages, almost all of which had the same text, except for the first one.
that’s strange, if the game doesn’t automatically stop when it reaches the breakpoint then it must never enter the functions in the first place, i have never seen that specific error before, i will look into it
Thank you very much for your help. I will clone the project and try a few things on my own for now. To me, the strangest thing is that only the right side interacts with the character. The previous attempt had the same problem. Only the right side seems to work. (?)