### Camera Shake with Instance Example Source: https://yiannis123git.github.io/ShiftUnlocked/CameraMethods Demonstrates using Camera:ShakeWithInstance with a custom CameraShakeInstance and a preset. Shows one-time and sustained shakes, and how to stop them using StartFadeOut. ```lua local NewCameraShakeInstance = ShiftUnlockedModule.CameraShakeInstance.new(5, 5, 0.2, 1.5) local PresetCameraShakeInstance = ShiftUnlockedModule.CameraShakePresets.Explosion -- One time explosion ShiftUnlockedCamera:ShakeWithInstance(PresetCameraShakeInstance, false) -- Sustained custom shake ShiftUnlockedCamera:ShakeWithInstance(NewCameraShakeInstance, true) -- Stop Sustained/One time shakes NewCameraShakeInstance:StartFadeOut(0) -- Instant Stop PresetCameraShakeInstance:StartFadeOut(2) -- Gradual stop ``` -------------------------------- ### ObstructionRange Source: https://yiannis123git.github.io/ShiftUnlocked/CameraProperties?q= If the camera moves closer to the player's character than this range, the character will start to become transparent for better camera visibility. ```APIDOC ## ObstructionRange ### Description If the camera moves closer to the player's character than this range, the character will start to become transparent for better camera visibility. ### Property `Camera.ObstructionRange: number` ### Type number ``` -------------------------------- ### new Source: https://yiannis123git.github.io/ShiftUnlocked/CameraMethods?q= Creates a new camera instance. ```APIDOC ## new ### Description Creates a new camera instance. ### Method new ### Signature _Camera.new(): SUCamera_ ### Parameters None ### Returns - **SUCamera** - The newly created camera instance. ### Example ```lua local camera = ShiftUnlockedModule.Camera.new() ``` ``` -------------------------------- ### Configure a custom RaycastChannel with SmartRaycast Source: https://yiannis123git.github.io/ShiftUnlocked/Setup Creates a custom raycast channel using the SmartRaycast module to ignore objects tagged with a CollectionService tag. The channel is then assigned to the camera's RaycastChannel property. This allows ignoring small or insignificant objects to improve user experience. ```lua local SmartRaycast = require(PathToOurModule.smartraycast) local function CanBeAdded(Inst) if Inst.Transparency == 1 or Inst.CanCollide == false then return true end return false end local CameraChannel = SmartRaycast.CreateChannel( "CameraChannel", {"OurCollectionServiceTag"}, CanBeAdded, Enum.RaycastFilterType.Exclude, -- ... ) ShiftUnlockedCamera.RaycastChannel = OurChannel ``` -------------------------------- ### Create a new ShiftUnlocked camera object Source: https://yiannis123git.github.io/ShiftUnlocked/Setup Requires the ShiftUnlocked module and creates a new camera object using the .new() function. The module path is a placeholder that should be replaced with the actual path to the module. ```lua -- First lets require our module by doing the folowing local ShiftUnlockedModule = require(PathToOurModule.shiftunlocked) -- Now we can create a camera object local ShiftUnlockedCamera = ShiftUnlocked.new() ``` -------------------------------- ### Enable camera with ShiftUnlockedCamera:SetEnabled(true) Source: https://yiannis123git.github.io/ShiftUnlocked/UsingTheCamera?q= Call SetEnabled(true) on the camera object to enable it after adjusting its settings. ```lua ShiftUnlockedCamera:SetEnabled(true) ``` -------------------------------- ### ShakeWithInstance Source: https://yiannis123git.github.io/ShiftUnlocked/CameraMethods?q= Shakes the camera using a CameraShakeInstance, either sustained or one-time, with optional fade-out control. ```APIDOC ## ShakeWithInstance ### Description Shake the camera by providing a CameraShakeInstance. You can create a CameraShakeInstance through the CameraShakeInstance's `.new()` constructor or by using one of the presets. The `Sustain` parameter determines if the camera shake should be sustained or not. ### Method ShakeWithInstance ### Signature _Camera:ShakeWithInstance(CShakeInstance: CameraShakeInstance , Sustain: boolean)_ ### Parameters - **CShakeInstance** (CameraShakeInstance) - Required - The camera shake instance to apply. - **Sustain** (boolean) - Required - If `true`, the shake is sustained; if `false`, it is one-time. ### Returns None ### Example ```lua local NewCameraShakeInstance = ShiftUnlockedModule.CameraShakeInstance.new(5, 5, 0.2, 1.5) local PresetCameraShakeInstance = ShiftUnlockedModule.CameraShakePresets.Explosion -- One time explosion ShiftUnlockedCamera:ShakeWithInstance(PresetCameraShakeInstance, false) -- Sustained custom shake ShiftUnlockedCamera:ShakeWithInstance(NewCameraShakeInstance, true) -- Stop Sustained/One time shakes NewCameraShakeInstance:StartFadeOut(0) -- Instant Stop PresetCameraShakeInstance:StartFadeOut(2) -- Gradual stop ``` ``` -------------------------------- ### Enable ShiftUnlocked camera with SetEnabled(true) Source: https://yiannis123git.github.io/ShiftUnlocked/UsingTheCamera Enables the ShiftUnlocked camera by calling SetEnabled with true. After this, the camera is active and can be used. ```lua ShiftUnlockedCamera:SetEnabled(true) ``` -------------------------------- ### Shake Source: https://yiannis123git.github.io/ShiftUnlocked/CameraMethods?q= Shakes the camera by passing shake properties directly as arguments, without needing a predefined CameraShakeInstance. ```APIDOC ## Shake ### Description Shake the camera by passing the properties of a CameraShakeInstance as arguments directly to the `:Shake` method, without the need to provide a predefined CameraShakeInstance. This is particularly useful in scenarios where a preconfigured shake is not applicable. ### Method Shake ### Signature _Camera:Shake(Magnitude: number, Roughness: number, Sustain: boolean?, FadeInTime: number?, FadeOutTime: number?, PositionInfluence: Vector3?, RotationInfluence: Vector3?)_ ### Parameters - **Magnitude** (number) - Required - The magnitude of the shake. - **Roughness** (number) - Required - The roughness of the shake. - **Sustain** (boolean) - Optional - Whether the shake is sustained. - **FadeInTime** (number) - Optional - Time to fade in the shake. - **FadeOutTime** (number) - Optional - Time to fade out the shake. - **PositionInfluence** (Vector3) - Optional - Influence on position. - **RotationInfluence** (Vector3) - Optional - Influence on rotation. ### Returns None ### Example ```lua camera:Shake(5, 5, false, 0.2, 1.5) ``` ``` -------------------------------- ### GamepadDeadzone Source: https://yiannis123git.github.io/ShiftUnlocked/CameraProperties?q= Specifies the range of gamepad input values near 0 that will be mapped to an output of 0 to prevent unintentional inputs. ```APIDOC ## GamepadDeadzone ### Description Specifies the range of gamepad input values near 0 that will be mapped to an output of 0 to prevent unintentional inputs. ### Property `Camera.GamepadDeadzone: number` ### Type number ``` -------------------------------- ### Destroy ShiftUnlocked camera with Destroy() Source: https://yiannis123git.github.io/ShiftUnlocked/UsingTheCamera Destroys the camera object, freeing resources after use. The camera should no longer be used after destruction. ```lua ShiftUnlockedCamera:Destroy() ``` -------------------------------- ### ShiftUnlockedCamera:SetEnabled(true) Source: https://yiannis123git.github.io/ShiftUnlocked/UsingTheCamera Enables the camera when passed true, disables it when passed false. ```APIDOC ## SetEnabled ### Description Enables or disables the camera. Pass true to enable, false to disable. ### Method SetEnabled ### Parameters - **enabled** (boolean) - Required - Set to true to enable the camera, false to disable. ### Request Example ```lua ShiftUnlockedCamera:SetEnabled(true) ``` ### Response No return value. ``` -------------------------------- ### Disable camera with ShiftUnlockedCamera:SetEnabled(false) Source: https://yiannis123git.github.io/ShiftUnlocked/UsingTheCamera?q= Call SetEnabled(false) on the camera object to disable it. ```lua ShiftUnlockedCamera:SetEnabled(false) ``` -------------------------------- ### Destroy camera with ShiftUnlockedCamera:Destroy() Source: https://yiannis123git.github.io/ShiftUnlocked/UsingTheCamera?q= Call Destroy() on the camera object to destroy it after use. ```lua ShiftUnlockedCamera:Destroy() ``` -------------------------------- ### Destroy Source: https://yiannis123git.github.io/ShiftUnlocked/CameraMethods?q= Cleans up references and connections established by the module. Once invoked, the camera should never be used again. ```APIDOC ## Destroy ### Description Cleans up references and connections established by the module. Once the destroy method is invoked on a camera, that camera should never be used again. ### Method Destroy ### Signature _Camera:Destroy()_ ### Parameters None ### Returns None ### Example ```lua camera:Destroy() ``` ``` -------------------------------- ### GamepadKValue Source: https://yiannis123git.github.io/ShiftUnlocked/CameraProperties?q= Controls the thumbstick input sensitivity for positive inputs. Lower values result in more responsive extremes, while higher values provide smoother, more linear control. ```APIDOC ## GamepadKValue ### Description Controls the thumbstick input sensitivity for positive inputs. Lower values result in more responsive extremes, while higher values provide smoother, more linear control. ### Property `Camera.GamepadKValue: number` ### Type number ### Remarks - Lower values: more responsive extremes - Higher values: smoother, more linear control ``` -------------------------------- ### Disable ShiftUnlocked camera with SetEnabled(false) Source: https://yiannis123git.github.io/ShiftUnlocked/UsingTheCamera Disables the ShiftUnlocked camera by calling SetEnabled with false. This stops the camera functionality. ```lua ShiftUnlockedCamera:SetEnabled(false) ``` -------------------------------- ### SetCharacter Source: https://yiannis123git.github.io/ShiftUnlocked/CameraMethods?q= Sets a character to override the local player's character, useful for spectating other players or NPCs. ```APIDOC ## SetCharacter ### Description Sets a character to override the local player's character. You can use any character that contains a humanoid. The character will act as the new character that the camera uses. This feature can be used for spectating other players or NPCs. To re-enable the default behavior, use SetCharacter on the local player's character. ### Method SetCharacter ### Signature _Camera:SetCharacter(Character)_ ### Parameters - **Character** (any) - Required - The character to use as the camera's target. Must contain a humanoid. ### Returns None ### Example ```lua camera:SetCharacter(otherPlayer.Character) ``` ``` -------------------------------- ### SetZoom Source: https://yiannis123git.github.io/ShiftUnlocked/CameraMethods?q= Sets the camera's zoom to the specified value, constrained within min/max zoom values. ```APIDOC ## SetZoom ### Description Sets the camera's zoom to the specified zoom number. The provided zoom will be constrained within the minimum and maximum zoom values. ### Method SetZoom ### Signature _Camera:SetZoom(Zoom: number)_ ### Parameters - **Zoom** (number) - Required - The desired zoom value. ### Returns None ### Example ```lua camera:SetZoom(10) ``` ``` -------------------------------- ### SetEnabled Source: https://yiannis123git.github.io/ShiftUnlocked/CameraMethods?q= Enables or disables the camera based on the passed boolean value. ```APIDOC ## SetEnabled ### Description Enables or disables the camera based on the passed value: `true` to enable and `false` to disable the camera. If `SyncZoom` is enabled, deactivation calls will yield for a short period of time. ### Method SetEnabled ### Signature _Camera:SetEnabled(Enabled: boolean)_ ### Parameters - **Enabled** (boolean) - Required - Set to `true` to enable the camera, `false` to disable it. ### Returns None ### Example ```lua camera:SetEnabled(true) ``` ``` -------------------------------- ### RaycastChannel Source: https://yiannis123git.github.io/ShiftUnlocked/CameraProperties?q= The Channel that will be used for that camera's raycast operations. For more information, please visit SmartRaycast's documentation page. ```APIDOC ## RaycastChannel ### Description The Channel that will be used for that camera's raycast operations. For more information, please visit SmartRaycast's documentation page. ### Property `Camera.RaycastChannel: Channel | nil` ### Type Channel | nil ``` -------------------------------- ### CorrectionReversion Source: https://yiannis123git.github.io/ShiftUnlocked/CameraProperties?q= Whether or not camera collision corrections will be reverted gradually or instantly. ```APIDOC ## CorrectionReversion ### Description Whether or not camera collision corrections will be reverted gradually or instantly. ### Property `Camera.CorrectionReversion: boolean` ### Type boolean ``` -------------------------------- ### Adjust camera properties: MaxZoom and ZoomLocked Source: https://yiannis123git.github.io/ShiftUnlocked/Setup Sets the camera's maximum zoom value to 100 and disables zoom functionality by setting ZoomLocked to true. These adjustments are recommended before enabling the camera. ```lua -- Let's adjust the camera's maximum zoom value, as the default value is a bit too large ShiftUnlockedCamera.MaxZoom = 100 -- Actually, let's just disable the zoom functionality completely ShiftUnlockedCamera.ZoomLocked = true ``` -------------------------------- ### StopShaking Source: https://yiannis123git.github.io/ShiftUnlocked/CameraMethods?q= Stops all camera shakes, optionally using a fade-out time. ```APIDOC ## StopShaking ### Description Stops all camera shakes using the `FadeOutTime` argument. If no `FadeOutTime` is provided then the camera shake's `FadeInTime` will be used for each camera shake. ### Method StopShaking ### Signature _Camera:StopShaking(FadeOutTime: number?)_ ### Parameters - **FadeOutTime** (number) - Optional - The time over which to fade out the shakes. If not provided, each shake's `FadeInTime` is used. ### Returns None ### Example ```lua camera:StopShaking(2) ``` ``` -------------------------------- ### Disable RotateCharacter and Enable AutoRotate Source: https://yiannis123git.github.io/ShiftUnlocked/CameraProperties?q= Disables the camera's RotateCharacter property and enables the Humanoid's AutoRotate property so the character rotates in the direction they are moving. ```lua ShiftUnlockedCamera.RotateCharacter = false LocalPlayer.Character.Humanoid.AutoRotate = true ``` -------------------------------- ### ShiftUnlockedCamera:Destroy() Source: https://yiannis123git.github.io/ShiftUnlocked/UsingTheCamera Destroys the camera object after use. ```APIDOC ## Destroy ### Description Destroys the camera object to free resources after use. ### Method Destroy ### Parameters None. ### Request Example ```lua ShiftUnlockedCamera:Destroy() ``` ### Response No return value. ``` -------------------------------- ### RotateCharacter Source: https://yiannis123git.github.io/ShiftUnlocked/CameraProperties?q= Sets whether or not the Humanoid will automatically rotate to face in the direction the camera is looking. When set to false, the character rotation will no longer be updated at all. ```APIDOC ## RotateCharacter ### Description Sets whether or not the Humanoid will automatically rotate to face in the direction the camera is looking. When set to false, the character rotation will no longer be updated at all. This is done to allow you to add custom character rotation behavior while still retaining the camera functionality. If you want the character to rotate in the direction they are moving, simply set the local character's humanoid AutoRotate property to true after you disable the camera's RotateCharacter property. ### Property `Camera.RotateCharacter: boolean` ### Type boolean ### Example ```lua ShiftUnlockedCamera.RotateCharacter = false LocalPlayer.Character.Humanoid.AutoRotate = true ``` ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.