Does anyone know how to make your camera move like this changing your character direction the same way?
this is what i have in my script
RunService.RenderStepped:Connect(function(updateMovement)
if (Camera.Focus.p-Camera.CoordinateFrame.p).magnitude > 1 then
local prev_mousehit
if isFlying then
local waist = Char:WaitForChild("LowerTorso"):WaitForChild("Root")
if Boost == true then
local mouseLocation = Vector3.new(Mouse.Hit.X, HRP.Position.Y, Mouse.Hit.Z)
HRP.CFrame = CFrame.new(HRP.Position, mouseLocation)
end
if not W and not S and not A and not D and not Up and not Down and Boost then
Boost = false
if AnimTrack then AnimTrack:Stop() end
BoostFunc()
end
if W then
--Direct = CM.Camera.CFrame.RightVector*1/2 + Direct
Direct = HRP.CFrame.LookVector + Direct
end
if S then
--Direct = CM.Camera.CFrame.LookVector*-1/2 + Direct
Direct = HRP.CFrame.LookVector*-1 + Direct
end
if A then
--Direct = CM.Camera.CFrame.RightVector*-1/2 + Direct
Direct = HRP.CFrame.RightVector*-1+ Direct
end
if D then
--Direct = CM.Camera.CFrame.RightVector*1/2 + Direct
Direct = HRP.CFrame.RightVector + Direct
end
if Up then
Direct = Vector3.new(0,1/2,0) + Direct
end
if Down then
Direct = Vector3.new(0,-1/2,0) + Direct
end
Bv.Velocity = Direct*Speed
Direct = Vector3.new()
end
end
end)```
7 Likes
You could use TweenService if you want it to be more fluent
5 Likes
how would i go about it with what i did?
4 Likes
would it be something like this?
if Boost == true then
local mouseLocation = Vector3.new(Mouse.Hit.X, HRP.Position.Y, Mouse.Hit.Z)
HRP.CFrame = CFrame.new(HRP.Position, mouseLocation)
TweenService:Create(Char.LowerTorso.Root,TweenInfo.new(.2),{C0 = CFrame.Angles(math.rad(45),0,0)}):Play()
end
4 Likes
We’re you have the if statement to change the look vector you could tween the player current look vector to the desired look vector when you press the keys
4 Likes
can you show and example or is the way i did it some what close?
4 Likes
Your example would work though you might need to adjust the easing style and values to get the effect your looking for
2 Likes
alright quick question how would get the mouse lock to be locked but the mouse move like that in the video nvm
3 Likes
You could make the mouse invisible using a decal of the mouse, then add a small dot GUI in the middle (which you can also use for aiming).
4 Likes
alright i will give it a try and let you know
4 Likes
i got somewhere all i need to do is make the camera make me move where im pointing
3 Likes
If you still need help with the movement you could break it up into quadrants checking if the mouse within a specific range of coordinates then moving it accordingly
1 Like
i got that part right now all i need to do is make the cand the way the torso or head is moving and go that direction turning the the body the way the head turns
1 Like
I found a way but the camera doesnt stay with the body at all
https://gyazo.com/70d4178a17eacf9891c2cf69cba6df91
Camera.CFrame = Camera.CFrame:Lerp(CFrame.lookAt(Vector3.new(0, 2, 0),Mouse.Hit.Position),0.05)
1 Like
Why don”t you have a camera part in the model and then set the camera to that
1 Like
but it would mess with the camera?
What do you mean? How would it affect it?
oh a part to keep the camera close the player??
Yes a part that is at the side of the player which you can set the camera to. You can use characteradded function and get the character of the player then position it relitive to the player using vector3. If you have a suit you could attach it there also
i did that but the camera just dont turn any more