Spectator system

So I have my system and it works, but do you guys think it is better to allow players to endlessly click both the back and forward button to change camera endlessly. Or stop them? The problem with the endless option is that sometimes it will bug out, so sometimes it’ll take a second click to switch the camera. Or could I just keep it limited would that annoy anyone?

If I was a player I would like to be able to press endlessly because being forced to press the other button could be a inconvenience.

1 Like

Yes and I would do that but the problem is when it reaches the end it sometimes bugs out and requires a second click.

WHAT exactly do you mean by “sometimes it will bug out”? Do you mean the camera failing to spectate the player? You should show us code.

I just meant this:

That’s the problem with the endless.

You should use a debounce or check your sanity-checks. Can’t really help you much if you don’t provide code

I am using debounces + sanity checks, I don’t think there’s much use of fixing it though because it is just an extra click and to me if it works it works. But an easier fix would be to just not allow the endless clicking.

still need to see your code, otherwise we won’t be able to help you further

Well, do you want to fix the bug or work around it?
From a player’s perspective, looping is preferable.
From your perspective, working around the bug may be easier.

I don’t want to fix it, I just wanna know which one is more preferable. Looping with an extra click needed, or just not being able to loop but it works perfectly.

uhhh what
you should set the players that can be spectated in an order, then move up and down with the arrow keys. get it?

Yeah I’ve already done that, How else do you think it was made? I just wanna know which is more preferable, the looping with an extra click or just not looping at all but it working fine.

can’t you do:

local playersInGame = {}--add players in game here
local current = 1

local function switch(right: boolean)--you can even just change this to a number 
--and use it as offset instead of the terinary thingy.
  local offset = right and 1 or -1
  current = current + offset
--modify current if it is out of bounds
  if current <= 0 then current = #playersInGame 
  elseif current  >= #playersInGame then current = 1 end

  workspace.CurrentCamera.CameraType = Enum.CameraType.Watch --or something else idk
  workspace.CurrentCamera.CameraSubject = playersInGame[current].Character.Humanoid

and then in buttons you can just say:

--replace with actual buttons
rightbutton.Activated:Connect(function() switch(true) end)
leftbutton.Activated:Connect(function() switch(false) end)

and boom it loops through the array of players, now you just need to add or remove players from this array.

I hope that this is what you meant, and also good luck!
also looping is preferable, for the players’ experience

So ignore the extra click? It’s still fine?

choose what you think is best :blush::blush::blush:

Okay jeez that’s kinda creepy.

not sure what you mean by that, if you think it’s because of the emoji i placed, that’s roblox’s fault for making it look extra weird

Yeah it was the emoji. A bit creepy.

yes, some players might just get confused as to why it didn’t work the first time but yes.
it is like this, descending priority btw:

  1. no bugs loop
  2. with bugs loop
  3. no loop

not looping is just tedious

Well alright, I didn’t take your script because I just like learning myself + for the record I find it much harder to understand other people’s scripts.