Started making my take on FNaF / Observation Duty

I had this idea for a while. I don’t have much done because I only started today but here is my idea. The game is called “Night Shift at Louie’s” You play as a new night guard at a grocery store called “Louie’s” and you have to keep the ghost/entity from getting out. I’m thinking about using audio cues to keep the ghost from getting out. But I feel like I need to come up with more than just that.

If you have any ideas, feel free to let me know.

In terms of what I have done so far, I have the camera switching working and I started working on the store itself.

I still have a lot to do. So here is the code for the camera switching I came up with if you’re curious :

extends Node3D

@export var current_camera = 0

func _input(event: InputEvent):
	#camera change input
	if Input.is_action_just_pressed("left"):
		current_camera -= 1
	if Input.is_action_just_pressed("right"):
		current_camera += 1
		
func _process(delta):
	#changes camera
	if current_camera == 0:
		$Camera1.set_current(true)
	if current_camera == 1:
		$Camera2.set_current(true)
		
	#loops back to first / last camera
	if current_camera == -1:
		current_camera = 1
	if current_camera == 2:
		current_camera = 0

There’s probably a better way to do this.

1 Like

Your camera code could be simplified if you used an Array to store your cameras. You can just keep adding cameras to that array in the inspector without worrying about changing the code or any other special references to the cameras.

extends Node3D

@export var cameras: Array[Camera3D]
var current_camera: int = 0

func _input(event: InputEvent):
	#camera change input
	if Input.is_action_just_pressed("left"):
		current_camera = wrapi(current_camera - 1, 0, cameras.size() - 1)
		cameras[current_camera].set_current(true)
	if Input.is_action_just_pressed("right"):
		current_camera = wrapi(current_camera + 1, 0, cameras.size() - 1)
		cameras[current_camera].set_current(true)

Good luck in your project :slight_smile:

1 Like