I am currently working on a huge project with a few of my friends, and for the third person gun system I heavily modified Roblox’s gun kit. I was able to implement a custom mesh, animations, ADS, and sprint system. My only problem is that in the ShoulderCamera library, it forces ShoulderCamera even when a player is not holding the gun. Is there any way I could modify and fix this? Thanks!
Did you try setting the camera to scriptable before doing that ?
The ShoulderCamera system already does that. What I am trying to do is make it so that it only uses the ShoulderCamera when the gun is equipped.
I think you should be using the BindToRenderStep function. Check this out, it could help.
How would I implement this? Cause the ShoulderCamera itself is done and fine, but it’s always on which is what I don’t want.
This is an example right here
local runService = game:GetService('RunService')
local camera = workspace.CurrentCamera
camera.CameraType = Enum.CameraType.Scriptable
local character = player.Character or player.CharacterAdded:Wait()
local function adjustCamera()
camera.CFrame = CFrame.new(character.Torso.CFrame * CFrame.new(0, 0, 5)
end
runService:BindToRenderStep('CameraBehindPlayer', 201, adjustCamera)
Have you tried putting it under Tool.Equipped ?
No, cause the ShoulderCamera system I was using was module based. I’ll try your version out and let you know how it works. Thanks for the help!
tool.equipped:Connect(function()
-- do the thing
end)
tool. Unequipped:Connect(function()
-- stop the thing
end)
I know how to use the equipped function. I’m just wondering how I would integrate an already made shouldercamera into this.
you could use script.Enabled = true but there are better ways of doing that