I am running into issues where I need to access the Camera.Focus property during user input processing. When using the normal camera mode/scripts, this is without issue, as the this property is always set to be approximately the player’s character’s head, but I am running into problems when I switch the camera to Scriptable and implement my own system.
I am setting Camera.Focus every frame, but it doesn’t end up getting set until my function bound via RunService:BindToRenderStep is processed, and this always happens after input processing regardless of what my RenderPriority is set to. The consequence of this is that my input handlers get a useless value for Camera.Focus, which appears to be exactly 20 studs in front of the camera.
I have verified that there are no other scripts attempting to set the Camera.Focus property, including the default camera scripts, as this behavior will occur even when there are no scripts changing the camera at all, so I’m assuming this value is assigned by the engine itself. Most notably, this overwriting only seems to occur when the camera is set to Scriptable, presumably to pick up after those who aren’t setting themselves, but that’s just speculation.
I can store the correct value whenever it is set, but this requires much more restructuring of my code to ensure everything is accessing the correct value, so I wanted to see if I was just missing something simple. Is there a way that I can ensure Camera.Focus is properly set prior to input being processed?