Creating a speeding camera in Roblox

For an upcoming game I am trying to make a camera that detects a player in car going above a set speed limit.

I have decided already to make use of velocity to detect whether they are travelling fast than what is set but I am unsure on how to trigger this event to happen. I have heard about doing touchstarted and touchended but I’m not sure how I would check only a player and not just the car. I also have heard stories about it not being very reliable.

Is there any other suggestions as to how I should go about triggering the velocity check for just the player?

Thank you for your help,
Pure.

Theoretically, you could use raycasts from a speed camera to see if there are any players nearby. If there are, then check the speed of that player.

Pseudo-ish:

ray.New()
if rayCanSeeAnyPlayers then
	if playerSpeed > speedLimit then
		print("is speeding")
	end
end
2 Likes

Thank you for the suggestion. I got it working with raycasts and it now detects players going above 50. :slight_smile:

image

Thanks again.

2 Likes