Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Camera Follows Car Until CameraType is Changed then Changed Back?

Asked by 6 years ago

This is going to be difficult to describe but I will do my best. Setting the player's CameraType at their spawn does exactly what it should; however, no matter what, when the player enters a vehicle, their CameraType is set to Custom and the camera angle is reset. The interesting part is that the Custom CameraType acts similarly to the Follow CameraType in that it will rotate fluidly to stay behind the car. When the player moves the camera by right clicking and dragging, the following property of the camera is cancelled for a few seconds after the player stops moving the camera. I have a button that will change the CameraSubject and CameraType when held, and will reset it when released. After holding and releasing the button, it works fine and all properties of the camera seem unchanged. The problem, however, is that the camera no longer follows the car.

Ultimately, my goals are to: set the camera angle to something more desirable when entering the car, making the camera snap fluidly behind the car as soon as the player stops moving the camera, and keeping the following property of the camera even when the CameraType and CameraSubject are changed and reset.

I understand that this question is not entirely Lua and is partially just about Roblox Development in general, but I am hoping one of you is familiar enough with the Roblox camera system to answer this ridiculous problem. Thanks.

Answer this question