How do i make the player camera rotate

basically I want to know how with runservice I make the camera turn 0 degrees in first person

The furthest I’ve gotten is this:

camera.CFrame:Lerp(camera.CFrame * CFrame.Angles(0,math.rad(360),0),.2


edit: not work

yes I did it that way, I wrote it that way because I did it by hand in the devforum, I did it inside a runservice but it doesn’t work
add: not error

Lerp gives you an interpolated value. When you used .2, you were saying to go 20% to 360 degrees. It is basically a snapshot at that moment.

To use it in TweenService, you need to use TweenService:Tween() according to the documentation:

Instance (use camera)
TweenInfo (you make this before using :Tween() and put it in here)
Table of properties you want to modify and the goal result (table)

Your last argument should be basically what you wanted as the end result:

{
    CFrame = camera.CFrame * CFrame.Angles(0, math.rad(360), 0)
}
1 Like

I’m sorry for what I said in the topic but what I really need is a runservice

If you want to constantly run the tween, just use a loop that plays the tween then waits when the tween is completed using the Completed event as your yield (in other words, replacement of task.wait() that you might normally use).

If you want to use RunService (Stepped/Heartbeat/RenderStepped/etc), just simply increment the angle from 0 inside the math.rad() as your CFrame.Angles(), you don’t need the lerp.

1 Like

If that is the solution, as the frames go by, I add a value until little by little it reaches 360
question which axis should i use? if you want answer

Maybe Y? you can test anyways.

It’s not until it reaches 360, it can be even after. math.rad works with numbers above 360 anyways. If you care about it reaching 360, just do modulo by 360.

1 Like

Ok, rightly so, it was incomplete for those who need it, it is the first axis that appears in the CFrame.Angles(east,0,0)

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.