# setCurrentCameraSpacingOffset

Controls the camera offset for both Z and Y axis, exclusively for chase cameras.

```lua
        -- since Lua numbers are passed by value, not reference we need to repeat this inside the func(). Are there better ways to doing this? Yes. But this is just a simple exports demo.
        local usedOffsetY = cameraData.isFpv and camFpvYOffset or camChaseYOffset
        local usedOffsetZ = cameraData.isFpv and camFpvZOffset or camChaseZOffset

        inputContextButton(
            "Y Offset: ",
            "Y Offset",
            "Controls the camera offset on the y axis.",
            0, 10, -10, 0.05,
            usedOffsetY,
            function(val)
                if cameraData.isFpv then 
                    camFpvYOffset = val
                    dynamic:setCurrentFpvCameraSpacingOffset(usedOffsetY, usedOffsetZ) 
                else 
                    camChaseYOffset = val
                    dynamic:setCurrentCameraSpacingOffset(usedOffsetY, usedOffsetZ) 
                end
            end
        )

        inputContextButton(
            "Z Offset: ",
            "Z Offset",
            "Controls the camera offset on the Z axis.",
            0, 10, -10, 0.05,
            usedOffsetZ,
            function(val)
                if cameraData.isFpv then 
                    camFpvZOffset = val
                    dynamic:setCurrentFpvCameraSpacingOffset(usedOffsetY, usedOffsetZ) 
                else 
                    camChaseZOffset = val
                    dynamic:setCurrentCameraSpacingOffset(usedOffsetY, usedOffsetZ) 
                end
            end
        )
```
