Getting the camera of killer

So, I don’t think this has been asked before but correct me I’m wrong.

Most FPS games such as Arsenal and Phantom Forces get the killer’s camera in 3rd person. Whilst, I’m not sure how they do it, I know misusing a system like this would make it extremely expensive and sabotage the user’s performance, if not run smoothly.

Anyways, the point is how would you go-about creating a system like this?

Here’s how I’m currently thinking of doing this:

1. Each player would be inserted into a table
2. They would have a certain value
3. If they don’t have a certain value, it would assume they have died
4. These dead players would be known as “victims” within the script
5. Once the assumption is set, the victims would have a string value inserted, containing the killer’s name.
6. The victims camera is set to scriptable, and it would search the player’s table for the the killer’s name
7. Script would get the player’s camera associated with the killer’s name and have it in 3rd person
8. Killer’s camera would show over a span of 5 secs
9. Cycle repeats

Thanks, any help would be greatly appreciated!

1 Like

I think another possible way to do this is to tags the weapon being fired/used with the player ID or name like how the basic linked sword tracks kill and deaths.

I think you should research more into it and look at some free models for kill cams on the toolbox (which I saw) although be wary of viruses.

Although for the Camera I believe you can work out the specifics of the camera, you might want to check out over-the-shoulder camera to check out how to set the cameras CFrame and stuff:

1 Like

Yes I was thinking of doing that, but I completely overlooked that smh.

See I barely even use free models like that because their either outdated or purely don’t work. I’ll check into one again and see if I can fix it because the last time I looked into that was 3 years ago (noob scripting knowledge). Oh, and they have viruses like “HAHA YOU GOT INJECTED”.

For the camera, I’ll just use a simple way and mess around with its properties.

For getting a players camera you cannot get the object so to speak from another client as it wont be replicated. You could repeatedly pass the information through the server to the other player but that could potentially effect performance.

It can be done but would require repeated client1 - server - client2 communication.

You can do this with a value or with remotes.

Your probably wondering why I you cant just pass the Cameras instance through. That is because its only visible to that client, if you were to take the camera instance you would find that the instance passed on wont changed if the player was to move their camera and would be stuck in one spot.

1 Like

you can just set the killed person’s camera’s camerasubject to the killer’s humanoid, and then set the cameratype to follow

Thats true but if its a free camera than if the killer moves their camera it wont make their camera do the same.

then set the subject to the killer’s rootPart
if its a fps game, then the rootpart moves with the cam
and then you could just offset the cam cframe

Steps:

  1. You got killed
  2. Get the killer
  3. Check if the killer is alive
  4. If they are, then
  5. Set the CameraType to Scriptable
  6. Update the camera by getting the CFrame of the killer HumanoidRootPart and multiplying that to a CFrame offset (cam.CFrame = killerRootPart.CFrame * CFrame.new(offset))