I am currently making a wall jumping ability for my first person game. Currently, wall jumping will turn your camera around instantly, but this looks bad, so I want to make it so your camera turns around smoothly, so it feels more realistic as you jump from wall to wall.
I tried tweening, but that won’t work because it’ll tween at the position the tween was triggered, rather than updating with the position of the character’s head.
Current code:
Humanoid.AutoRotate = true
HumanoidRootPart.Anchored = false
Character.Torso.WallJump:Play()
Character.Torso.WallDrag:Stop()
Character.Torso.Dive:Play()
local BodyVelocity = Instance.new("BodyVelocity", HumanoidRootPart)
BodyVelocity.MaxForce = Vector3.new(400000, 400000, 400000)
BodyVelocity.Velocity = -HumanoidRootPart.CFrame.LookVector * Settings.LookVectorMultiplier + Vector3.new(0, Settings.JumpHeight, 0)
game.Debris:AddItem(BodyVelocity, 0.1)
HumanoidRootPart.CFrame *= CFrame.Angles(0, math.rad(180), 0)
if game.Players.LocalPlayer.CameraMode == Enum.CameraMode.LockFirstPerson then
workspace.CurrentCamera.CFrame *= CFrame.Angles(0, math.rad(180), 0)
end
WallJumping = false
task.spawn(function()
repeat task.wait() until Humanoid.FloorMaterial ~= Enum.Material.Air
LastWall = nil
Character.WallJumpDeb.Value = false
end)