Hello, i have a script where i make a players cameraSubject a block but the block is constantly moving, when i set the camera to the block it goes to the last position the block was, how would i update the camera to the moving block?
Your code should look something like this to achieve the wanted result (Make sure that the Camera is Scriptable):
local OFFSET_FROM_PART = (5);
camera.CFrame = CFrame.lookAt((object.CFrame * CFrame.new(0, 0, -OFFSET_FROM_PART)).Position, object.CFrame.Position)
-- // I am taking the object's CFrame and multiplying it by an offset CFrame that affects the lookVector, then I get the position of the newly calculated CFrame, and use CFrame.lookAt(), the origin position is the calculated CFrame's position, and the lookAt is the object.
Sorry let me explain fully, basically what I’m doing is when a proximity prompt is triggered the player who triggered it will be forced to walk to a attachment, I want it where while the player is walking to it they can’t move there camera so I put it to scriptable but then the camera doesn’t follow the currently moving players head so I tried moving the camera subject to the players head and it still doesn’t work…
Considering the fact that you already put the CameraMode on Scriptable, you can use this approach.
You can maybe use Attach or experiment with other CameraTypes that exclude the feature of turning around, and find the one that fits perfectly.