|
while true do
CurrentCamera.CoordinateFrame=Player.Character.Torso.CFrame
end
I think that's what it was. Can't really copy-paste it exactly because my studio crashed.
y-y-you too... |
|
DarkenusJoin Date: 2014-07-17 Post Count: 1997 |
.RenderStepped |
|
DarkenusJoin Date: 2014-07-17 Post Count: 1997 |
http://wiki.roblox.com/index.php?title=API:Class/RunService/RenderStepped
basically,
--localscript
game:GetService("RunService").RenderStepped:connect(function()
CurrentCamera.CoordinateFrame=Player.Character.Torso.CFrame
end) |
|
cntkillmeJoin Date: 2008-04-07 Post Count: 49450 |
OP you forgot a wait or something |
|
|
I know. I tried to make it less jiterry. It crashed my game and that was the last thing in there that I got from the autosave.
y-y-you too... |
|
|
Thanks. That helped @darkenus
y-y-you too... |
|
blenceJoin Date: 2014-02-12 Post Count: 84 |
You really want a wait in there, it will crash otherwise because you basically told roblox studio to run that line of code an infinite amount of times in 0 seconds.
An easy fix would be
while true do
CurrentCamera.CoordinateFrame=Player.Character.Torso.CFrame
wait()
end
though someone else has posted something more efficient.
|
|
DarkenusJoin Date: 2014-07-17 Post Count: 1997 |
renderstepped is your bestie when trying to focus players camera.
if you use:
while wait() do
end
the player can still move the camera - but only for like a split second b4 they are forced back onto what you said to look at
however, with renderstepped - its fires at ever frame, so they CANNOT move their camera.
plus, its just awesome |
|
|
Do what dark is saying
game:GetService("RunService").RenderStepped:connect(f) is super smooth. |
|
|
what's (f)?
y-y-you too... |
|
DarkenusJoin Date: 2014-07-17 Post Count: 1997 |
@electro
'f' would be the function
aka
=============================
function f()
CurrentCamera.CoordinateFrame=Player.Character.Torso.CFrame
end)
game:GetService("RunService").RenderStepped:connect(f) |
|
|
'the player can still move the camera - but only for like a split second b4 they are forced back onto what you said to look at'
What kind of a monster tries to manipulate the camera like this and doesn't disable the default camera scripts? |
|
DarkenusJoin Date: 2014-07-17 Post Count: 1997 |
What kind of a monster tries to manipulate the camera like this and doesn't disable the default camera scripts?
what r u talking about. disabling the normal camera scripts doesnt do a difference....
its because wait() does not occur at every frame and renderstepped does. so renderstepped is the smoothest |
|
|
If you disable the default camera scripts they can't move the camera, at all.
There is no dragging it for a second because you can no longer drag it |
|
DarkenusJoin Date: 2014-07-17 Post Count: 1997 |
omg u are a genius. i did not know this. now i can implement this into my project that i was dealing with. |
|
|
that wasn't really the answer to my specific question. I found out when I did this.
RunScript.RenderStepped:connect(function(f)
print(f)
end
I think it has something to do with the amount of time between the last rendered frame? Idk. But I'll also try disabling the default camera scripts. Thanks for all the help guys!
|
|
DarkenusJoin Date: 2014-07-17 Post Count: 1997 |
|
|
|
Oh. That makes sense. I'll do more research and see how I can apply this.
y-y-you too... |
|