Hello im trying to do custom camera position but i got some little problem (im only clicking w or s)
RS = game:GetService("RunService")
local camera = workspace.CurrentCamera
RS:BindToRenderStep("LockCamera", 1, function( )
local characterCFrame = game.Players.LocalPlayer.Character.PrimaryPart.CFrame
camera.CameraType = Enum.CameraType.Scriptable
camera.CFrame = characterCFrame * CFrame.new(4,2,8)
end)
If u have another way share it. TY!
That’s the auto rotate kicking in there. I have been there before.
Under Humanoid’s properties disable AutoRotate and your character won’t try to turn while moving.
3 Likes
RunService:fireRenderStepEarlyFunctions unexpected error while invoking callback: Workspace.ReizMehmet.LocalScript:9: attempt to index number with ‘AutoRotate’
I got to the this error
humanoid.AutoRotate = false
And if i write inside the function i got this error but if i write outside the function not rotating
put it outside of the loop, it don’t need to be updated every frame.
! Try this before function
This is if script is in character scripts, if in player scripts you will have to wait for character.
local plr = game.Players.LocalPlayer
local human = plr.Character:FindFirstChild("Humanoid") :: Humanoid
human.AutoRotate = false
Full Code I tested(with script in StarterCharacterScripts)
`RS = game:GetService(“RunService”)
local camera = workspace.CurrentCamera
local plr = game.Players.LocalPlayer
local human = plr.Character:FindFirstChild(“Humanoid”) :: Humanoid
human.AutoRotate = false
RS:BindToRenderStep(“LockCamera”, 1, function( )
local characterCFrame = game.Players.LocalPlayer.Character.PrimaryPart.CFrame
camera.CameraType = Enum.CameraType.Scriptable
camera.CFrame = characterCFrame * CFrame.new(4,2,8)
end)`
i replied it upper message now character not rotating. Im trying to do MMORPG game camera
I see, so you want the auto rotate on, but not when walking backwards.
Can u check the video again . Problem is if i going to back my character is spinning and if i take a weapon my character walking left its my problem. I want to only change character camera position and lock it
It is the auto rotate, cause the camera follows based off of were the character is facing. If you are trying to make a custom shift-lock that maybe worth looking up as there is some stuff on that.
Seems like the Camera offset would be what you are looking for.
local human = plr.Character:FindFirstChild("Humanoid") :: Humanoid
human.CameraOffset = Vector3.new(0,0,1)
note: this is not used in a loop or RunService