#How to make the camera be like in the game hours.
1 messages · Page 1 of 1 (latest)
put this in a local script
game:GetService("UserInputService").MouseBehavior = Enum.MouseBehavior.LockCenter
yes thanks now i just need to somehow make it go 2 studs to the left
i mean right
** You are now Level 1! **
oh that's about the camera
i checked the game hours and notice that it follows a focus point hovering around the player's head
yes but it hovers to the right a bit i think
did the same thing i don't think i messed anything up but it still doesn't work
Ur missing = after “RV”
And also, the sceipt and video is just a demonstration i recommend using an attachment rather than a part for focus point
alr. Well i can't really get it to work right so Ill make a new post
Just tell me what’s wrong
** You are now Level 2! **
well offseting the camera but getting the cursos to be above my shoulder not on my avatars head
You can see i already did that in this video
If you dont know what was truly wrong with the script you wrote then turn on output tab
ok now your code up there works just it doesn't follow my chracter at all
also for me its not a cube :|
Just… screenshot ur studio for me bro 😭
what part????
The whole thing
I surposse the floor is named “Part”…
yea
Ofc it doesnt work
yea i could just rename the cube and in the code change the "part" thing
The script earlier i send pick an ovject named “Part” and make it the focus point
You can add a part into the workspace
Rename it into something else
Like “focuspoint”
Then change the “part”s in the script into that name
And after it work you can change the added brick’s transparency to 1 and cancollide to false
okay so now it still doesn't work and a random wall apears after you spawn
** You are now Level 2! **
ooh do i unlock it?
And scale the cube down btw
do i change the workspace.part the part in that to focuspoint?
Is the cube “focuspoint”?
i changed that now nothing spawns behind me
but i relized the cube falls to the ground
ye
Hmmm, try move it so that it float before starting the game
Oh wait i was stupid
** You are now Level 3! **
Change the script’s workspace.part to workspace.focuspoint
i did already
And it’s still doesnt work?
nope but it doesn't spawn a random part of the map behind me so that's fixed
what did you mean an attachment tho
Forget that for now, let’s focus on the main issue here
alright
Have you opened output tab like i said?
yeah i think
Does the tab has anything red when you play the game?
Insufficent permissions to set DevEnableMouseLockOption - Studio
The current thread cannot set 'DevEnableMouseLockOption' (lacking capability RobloxScript)
Invalid parent for Service. Studio cannot be parented to Game .
Script timeout: exhausted allowed execution time
What the?
Broooooo
Change the 0.002 to 0.02
** You are now Level 3! **
There should be a wait(0.02) at the end of the while loop
ok what
Pls dont tell me ur getting ragdolled
Desribe the problem you having rn
i edited it to 720p
How much time did you put in wait()?
you can anchor the part btw
0.02
ooh
al
r
now it works but its pretty glitchy
that's the only problem now
Can i see it?
Weird becuz it was pretty smooth when i did it
really on video it also looked glitchy
i mean the character
is mostly glitching out since its like the cube teleports a bit if it could go smoothly it would be perfect
imma go eat something real quick
Ye true
In the game hours, they used lerp and tween service to make it smooth
no
Tween basiclly just move stuff in this context
Alr i will tru to write script with my phone
t = {}
t.Position = game.Players.LocalPlayer.Character.Head.Position + RV * 2
local tweenInfo =TweenInfo.new(0.5)
game:GetService(“TweenService”):Create(workspace.focuspoint, tweenInfo, t):Play()
wait(0.5)
Delete the workspace.focus.position and then paste this in
The thing under Local RV CFrame?
Focus as in focus point?
Yes
Yeah
Alr I'll send you a vid after I do that
Ngl this could have ended way earlier if i did and tested my script more carefully
Sorry for the inconvenience
** You are now Level 4! **
Nah dw it was kinda fun
You learn from failure? I never really learnt anything from it but I always think about that quote
It’s kinda late now, so if the thing i sent fail i will make a working one tmr, bye
Yea alr cya
Players.Gabrijelpler.PlayerScripts.LocalScript:15: Expected identifier when parsing expression, got Unicode character U+201c (did you mean '"'?) - Studio - LocalScript:15
Insufficent permissions to set DevEnableMouseLockOption - Studio
The current thread cannot set 'DevEnableMouseLockOption' (lacking capability RobloxScript)
Theese things are red in the output tab.
Also nothing happens now
this is how the code looks hopefully i didn't ruin anything
@empty hedge
local camera = workspace.Camera
local player = game.Players.LocalPlayer
local focuspoint = workspace:WaitForChild("focuspoint")
camera.CameraSubject = focuspoint
game:GetService("UserInputService").MouseBehavior = Enum.MouseBehavior.LockCenter
while true do
local LV = camera.CFrame.LookVector
local LVnoY = Vector3.new(LV.X,0,LV.Z)
local RV = CFrame.lookAlong(focuspoint.Position,LVnoY,Vector3.yAxis).RightVector
local goal = {}
goal.Position = player.Character.PrimaryPart.Position + Vector3.yAxis * 1.5 + RV *2
local ti = TweenInfo.new(0.08)
game:GetService("TweenService"):Create(focuspoint,ti,goal):Play()
wait(0.02)
end
that should be good
Yo looks awesome (sorry I just woke up even tho it's 1pm)