#How to make the camera be like in the game hours.

1 messages · Page 1 of 1 (latest)

empty hedge
#

I want to make it like shiftlock but so the player can still spin around and look in one direction. Also I want to remove scrolling away. So that its just locked in place but you can still turn it around wherever. Hope the question makes sense

edgy hound
#

put this in a local script

game:GetService("UserInputService").MouseBehavior = Enum.MouseBehavior.LockCenter

empty hedge
#

i mean right

spare larkBOT
#

studio** You are now Level 1! **studio

edgy hound
#

i checked the game hours and notice that it follows a focus point hovering around the player's head

empty hedge
#

yes but it hovers to the right a bit i think

edgy hound
#

script if ur curious

empty hedge
#

did the same thing i don't think i messed anything up but it still doesn't work

edgy hound
#

And also, the sceipt and video is just a demonstration i recommend using an attachment rather than a part for focus point

empty hedge
#

alr. Well i can't really get it to work right so Ill make a new post

edgy hound
spare larkBOT
#

studio** You are now Level 2! **studio

empty hedge
#

well offseting the camera but getting the cursos to be above my shoulder not on my avatars head

edgy hound
#

If you dont know what was truly wrong with the script you wrote then turn on output tab

empty hedge
#

ok now your code up there works just it doesn't follow my chracter at all

#

also for me its not a cube :|

edgy hound
empty hedge
#

what part????

edgy hound
#

The whole thing

empty hedge
edgy hound
empty hedge
#

yea

edgy hound
#

Ofc it doesnt work

empty hedge
#

I should rename it

#

and 1431 other stuff

edgy hound
#

I mean

#

You dont need to

empty hedge
#

yea i could just rename the cube and in the code change the "part" thing

edgy hound
#

The script earlier i send pick an ovject named “Part” and make it the focus point

edgy hound
#

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

empty hedge
#

okay so now it still doesn't work and a random wall apears after you spawn

spare larkBOT
#

studio** You are now Level 2! **studio

empty hedge
#

the code should be alr

edgy hound
#

Check its children

empty hedge
#

ooh do i unlock it?

edgy hound
#

Delete its welds

empty hedge
#

nvm it wasn't even locked

#

or anchored

edgy hound
#

And scale the cube down btw

empty hedge
edgy hound
empty hedge
#

i changed that now nothing spawns behind me

#

but i relized the cube falls to the ground

empty hedge
edgy hound
#

Hmmm, try move it so that it float before starting the game

empty hedge
#

it does already

edgy hound
#

Oh wait i was stupid

spare larkBOT
#

studio** You are now Level 3! **studio

edgy hound
#

Change the script’s workspace.part to workspace.focuspoint

edgy hound
#

And it’s still doesnt work?

empty hedge
#

nope but it doesn't spawn a random part of the map behind me so that's fixed

empty hedge
edgy hound
empty hedge
#

alright

edgy hound
#

Have you opened output tab like i said?

empty hedge
#

yeah i think

edgy hound
#

Does the tab has anything red when you play the game?

empty hedge
#

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

edgy hound
#

Broooooo

#

Change the 0.002 to 0.02

empty hedge
#

oh

#

...

#

i didn't even put that part in

spare larkBOT
#

studio** You are now Level 3! **studio

empty hedge
#

....

#

omg

edgy hound
#

There should be a wait(0.02) at the end of the while loop

empty hedge
#

ok what

edgy hound
#

Pls dont tell me ur getting ragdolled

empty hedge
#

no but

#

bruh dc doesn't allow me to send the video

edgy hound
#

Desribe the problem you having rn

empty hedge
edgy hound
#

you can anchor the part btw

empty hedge
#

0.02

#

ooh

#

al

#

r

#

now it works but its pretty glitchy

#

that's the only problem now

edgy hound
edgy hound
empty hedge
#

my slow ah wi fi

empty hedge
#

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

edgy hound
#

In the game hours, they used lerp and tween service to make it smooth

empty hedge
#

Whats that?

#

The animation thing?

edgy hound
#

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)

edgy hound
empty hedge
empty hedge
edgy hound
edgy hound
empty hedge
#

Alr I'll send you a vid after I do that

edgy hound
#

Ngl this could have ended way earlier if i did and tested my script more carefully

#

Sorry for the inconvenience

spare larkBOT
#

studio** You are now Level 4! **studio

empty hedge
#

You learn from failure? I never really learnt anything from it but I always think about that quote

edgy hound
empty hedge
#

Yea alr cya

empty hedge
#

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

edgy hound
#

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

empty hedge