#Camera Problem

56 messages · Page 1 of 1 (latest)

topaz swallow
#

not sure what's going on, but when other scripts invoke the "unlock()" function, modify the camera's CFrame, and then invoke "reset()", the cameramodule doesn't really save the modified cframe, causing the camera to face the last direction it was facing before unlock() was invoked.
i've tried constantly saving the current cframe of the camera after unlock function gets invoked, and returning after reset is invoked and no, doesnt work at all.

give me some suggestions if possible :)
also sorry for bad video quality, had to compress it

camera module script:
https://pastebin.com/kwHUa6wh

cursive sparrow
topaz swallow
#

check the pastebin

#

oh wait

#

u mean what script?

cursive sparrow
#

I mean where is reset and lock being called

topaz swallow
#

at the camera modulescript

cursive sparrow
#

Isn’t that where the function is being created

#

Not called

topaz swallow
#

oh

#

misread

#

on the door script, there's the serverscript for it, the one that handles the proximityprompt and fires a remote to the client, and the client is the one that calls unlock, plays the animation, and then calls reset

cursive sparrow
#

So is the same script calling reset and unlock

topaz swallow
#

yeah

cursive sparrow
#

Have you tried debugging the positions

round ospreyBOT
#

studio** You are now Level 8! **studio

cursive sparrow
#

Seeing if the positions are stored correctly

topaz swallow
#

yeah

#

this is the part of the localscript

cursive sparrow
#

Ur requiring it twice

#

Require it once in a variable

#

And then call unlock and reset on that variable

topaz swallow
#

that will do the same thing tho

cursive sparrow
#

So like local cameramodule = require(script)

cursive sparrow
topaz swallow
#

it will

#

that will just reduce the script length

cursive sparrow
#

If you call require multiple times it requires the script multiple times

topaz swallow
#

isnt it supposed to be like that

cursive sparrow
#

No

#

Just try having a variable at the top of the script

topaz swallow
#

fine

#

didnt fix anything

cursive sparrow
#

I just looked at the video and isn’t it doing what you want it to do

#

It’s going back to the original position after

#

Or do you not want it to do that

topaz swallow
#

i dont want that

#

xd

#

its weird

cursive sparrow
#

Are you just hiding the player and moving their camera?

topaz swallow
#

nope

#

it has a animation

#
  • the camera is getting locked to the player's head
#

when the animation is playing

cursive sparrow
#

Well I mean the problem ur having is with how the Roblox camera works

topaz swallow
#

i captured the stuff before animation > on animation
ignore position, just Y orientation

cursive sparrow
#

Try this

local x,y,z = camera.CFrame:ToEulerAnglesXYZ()
camera.CFrame = CFrame.new(camera.CFrame.Position) * CFrame.Angles(x,y,z) * CFrame.Angles(0,0,math.rad(2))

cursive sparrow
topaz swallow
#

i'm trying to modify the stored orientation of the modulescript after unlock is called

#

and then return the last frame's camera orientation direction once reset is called

cursive sparrow
#

There might be other camera modes that allow for that

topaz swallow
#

im pretty much just about to give up and let it be like that

round ospreyBOT
#

studio** You are now Level 5! **studio

topaz swallow
#

ill still try some other stuff