Is it common for scripters to parent viewport cameras to workspace? I always parent them to viewport frames seems like the most logical thing to do
asking this because other guy made a similar point earlier
Is it common for scripters to parent viewport cameras to workspace? I always parent them to viewport frames seems like the most logical thing to do
asking this because other guy made a similar point earlier
But it’s not required that you parent it to the VeiwportFrame. Roblox simply added a property of the workspace that allows game developers to easily find the camera the client is using. If you really want to use Workspace.Camera
you can do that.
Probably not. But it’s not a matter of commonality, but rather possibility. It is possible to have name conflicts where workspace.Camera
is either nil
or refers to the wrong camera. Thus using CurrentCamera
is definitely the way to go.
I never use workspace.Camera
and never will.
I understand where your coming from
It just seems like if you know what you’re doing then there nothing wrong in using workspace.Camera, incapaz made a valid point earlier that roblox might add a property named “Camera” which would def. cause issues but probability wise that close to 0 and even if it did come to happen, scripters would get warned ahead of time similar to the mandatory filtering enabled update
In a scenario if you were working in a team with unknown scripters then I would def see the reason in using CurrentCamera since you don’t know if the other scripters will add in multiple cameras under workspace
seems like it mostly just a protection against (in my opinion) dumb mistakes
When it comes to making programming design decisions, it’s always best to choose the most robust and safe option, given that the performance and implementation differences are minuscule. In this case, it’s as easy as changing the word Camera
to CurrentCamera
.
I understand that either work in most situations, but it makes more sense to use the property that was added specifically to keep consistency with interfacing with the player’s camera.