MaximumADHD / Character-Realism

A flexible character enhancement system for Roblox.
Mozilla Public License 2.0
103 stars 25 forks source link

Vehicle Camera Fixes #6

Closed Cuyler36 closed 3 years ago

Cuyler36 commented 3 years ago

This PR attempts to address issues with Character Realism and the new VehicleCamera camera mode in two ways.

Firstly, I removed the hacky head attachment detection. It is replaced with an overload for TransparencyController:SetupTransparency(character). This fixes the camera module being blocked by the overloaded TransparencyController:IsValidPartToModify(part) method. Without this, there is two seconds of delay before the camera module correctly switches upon exiting the vehicle, along with errors from the VehicleCamera module as the subject is no longer a VehicleSeat.

Secondly, I corrected undesirable behavior when entering a vehicle in first person. Currently, FpsCamera is not capable of detecting that the Humanoid is sitting in a VehicleSeat. If it doesn't unbind from RenderStep, an undesirable camera offset above the car is present in first person. This is corrected by the new check in RenderStep bound function where the subject has its SeatPart evaluated.

MaximumADHD commented 3 years ago

Looks good, this is definitely a smarter way of handling this. One of my concerns in trying to interact directly with the camelCase variables of TransparencyController is that they’re likely volatile, but it seems like the risk here is worthwhile if it means we can avoid putting blocks in code that aren’t expecting them.