#My TIO jumpscare camera is backwards (Related to CFrame)

1 messages · Page 1 of 1 (latest)

lofty pecan
#

Ok, I've got a TIO bot in my workspace right now that I managed to make work with some scripts in the toolbox. Like a raycasting script for him to see you, and a chase script which I recoded to both patrol and chase depending on what he's doing. (The video has him chasing me.)

Though I've got a problem getting his jumpscare camera to work.

I'm trying to make it move the player's camera with the HeadCamera bone inside of him, and a script inside a ScreenGUI that makes the camera scriptable and moves it to there.

I got it from a kit I found in the toolbox, and it wasn't working at all. I managed to get the script working again by switching it to use the HeadCamera's TransformedWorldCFrame, but... now the camera is displaying away from him instead of towards him.

Here's the camera script that enables itself when he's doing his jumpscare. I put it in RunService so it wouldn't be slowed down by the server lagging down.

local RunService = game:GetService("RunService")

RunService.PreRender:Connect(function()
    workspace.CurrentCamera.CFrame = workspace.TIO.HumanoidRootPart.Controller.HeadCamera.TransformedWorldCFrame
end)

And here's video of it in action. You guys got any idea what I'm doing wrong?

brave skiff
#

maybe rotate the camera?

lofty pecan
#

Turned it 90 and even 180.

brave skiff
#

oh

lofty pecan
#

I also tried inverting the CFrame with the minus trick (AKA putting a minus at the end of a number), but that just gives me this error every time the game updates.

brave skiff
#

what if u tried "number * -1" that math equation inverses the number

brave skiff
#

too

lofty pecan
#

I tried that and it was literally the same result. Though I think I'm onto something with CFrame.lookAt. You probably wouldn't know this, would you?
#1482622621769142334