To further describe what “position” is, in the picture below, my camera seems to also be looking at my clone’s right arm, however its “position” is different than the “position” my camera previously had.
Ok, that makes more sense. So you want the camera to switch over to your clone, and be rotated as if your clone had aimed their camera the exact same way relative to their character?
-- Get the camera
local Camera = workspace.CurrentCamera
-- Make a simple function
local function LookAt(part)
-- Make it manipulable
Camera.CameraType = Enum.CameraType.Scriptable
-- Look at it using CFrame.lookAt
Camera.CFrame = CFrame.lookAt(Camera.CFrame.Position, part.Position)
-- Allow other scripts to manipulate it again
Camera.CameraType = Enum.CameraType.Custom
end
-- Now, you can hook the following up to whatever you want:
LookAt(workspace.heavenswilI['Left Arm'])
(lag from the cursor is a roblox bug)
You could also use tweens to smooth it, like this:
local function LookAt(part)
Camera.CameraType = Enum.CameraType.Scriptable
local tween = game.TweenService:Create(
Camera,
TweenInfo.new(1),
{CFrame = CFrame.lookAt(Camera.CFrame.Position, part.Position)}
)
tween:Play()
tween.Completed:Connect(function()
Camera.CameraType = Enum.CameraType.Custom
end)
end
I would like to help a little too, but, tbh its a little confusing to understand the position, target and behaviour of the camera you want to achieve, I would ask for a drawing too as @azqjanna said
I rewatched the first video. You want your camera to toggle between between pointing directly at the clone’s left arm, to their right? What places the camera on the left arm initially? Or is the goal just to make the player camera look at one arm or the other, alternating each time the function runs?
Hi, thanks for taking the time. This was the output of the code, it’s not what I have in mind. Only at the end does it look at my clone’s right arm like I want it to (refer to my first post)
Hey. Yeah, no problem. Would you mind telling me what you want me to draw? I did my best explaining in my earlier post, so I don’t really know what to draw.
That is probably happening due to your character and the clone having the same name.
You can fix this by renaming the clone something random, and changing the “DisplayName” property of its humanoid.
Edit: Looking at the original code, I’m assuming you just put this into the while loop. You shouldn’t do that, instead, use the tween method I showed above.
As you know shift-lock has always put the camera above the right shoulder, it’s just how Roblox decided it should work, so even if you change the camera’s CFrame, the shift-lock script that manages the camera will override your changes. You’d have to fork the shift-lock camera module to make it compatible to whatever you want to achieve, it’s located somewhere under PlayerModule (StarterPlayerScripts, you have to test the game for it to appear). Or, alternatively you can use an open-sourced module made by another user (this should work), or you can just write the system yourself using CFrame.lookAt and the camera’s lookVector.