In my game the player is supposed to be first person, and be able to look around naturally. The Roblox “LockFirstPerson” property creates a pretty good version of that.
The problem arises from when I try to do a bobble effect. It is done by animating a part weilded to the head of the player and then renderstepping the camera to the part.
It seems that the Roblox property does something similar and so the gameplay will look like this (the file won’t upload for some reason so best way I can describe it is the 2 cameras constantly switching so it’s a seizure enducing experience).
The question is: What can be done to fix this? I have thought of 3 ways.
Make a bobble effect in a different way (can’t find any method)
Create a simulation of the first person locked camera that doesn’t mess witht he bobble
Somehow let them both coexist without there being seizure experience.
This is the script
local Player = game.Players.LocalPlayer
local char = Player.Character
local human = char:WaitForChild("Humanoid")
local root = char:WaitForChild("HumanoidRootPart")
local Animation = (Instance.new("Animation",human))
local Animator = (human.Animator)
Animation.AnimationId = "rbxassetid://11496894057"
local run = human:LoadAnimation(Animation)
local uis = game:GetService("UserInputService")
--functions
uis.InputBegan:Connect(function(input)
if input.UserInputType == Enum.UserInputType.Keyboard then
if input.KeyCode == Enum.KeyCode.W then
run:Play()
end
end
end)
uis.InputEnded:Connect(function(input)
if input.UserInputType == Enum.UserInputType.Keyboard then
if input.KeyCode == Enum.KeyCode.W then
run:Stop()
end
end
end)
game:GetService("RunService").RenderStepped:Connect(function()
game.Workspace.CurrentCamera.CFrame = char.Head.CFrame
end)
If I’m not mistaken using the .Subject property of the Camera should help emulate the effect you’re looking for. Also, make sure you’re setting the Camera as Scriptable!
Let me know if you need any more help or you work anything out!