local RunService = game:GetService("RunService")
local viewmodel = game.ReplicatedStorage.ViewModel:Clone()
local flashlight = game.ReplicatedStorage.Flashlight:Clone()
viewmodel.Parent = workspace.Camera
flashlight.Parent = workspace.Camera.ViewModel.RightArm.Handle
local camera = workspace.CurrentCamera
RunService.RenderStepped:Connect(function()
viewmodel.Camera.CFrame = camera.CFrame
end)
I am currently making a viewmodel script and I want it so everytime the viewmodel is activated, the flashlight parent is the handle i’ve set up in the arm. I also want the flashlight to always face the front no matter the rotation. Sorry if am not very good at explaining but an example of this is the Evade’s flashlight viewmodel.
Here is where the handle is setup. Please let me know if there is any better way to do this, Thank you!