#FPS Camera with rig issues

150 messages · Page 1 of 1 (latest)

faint coral
#

Hey, I have a camera, and I want the camera CFrame position to be set to the parts CFrame position but I dont want the camera rotation to be changed, how can I do this? Here's the current script lua local camera = game.Workspace:WaitForChild("Camera") game.Players.LocalPlayer.CameraMode = Enum.CameraMode.LockFirstPerson camera.CameraType = Enum.CameraType.Scriptable while true do if script.Parent.Head then camera.CFrame = script.Parent.Head.CFrame end task.wait() end

thorny mason
#

You mean the Orientation by Rotation?

faint coral
#

?

lament quartzBOT
#

studio** You are now Level 6! **studio

thorny mason
#

Like what do you exactly mean by Orientation.

#

I mean Rotation.

sharp violet
thorny mason
#
local camera = game.Workspace:WaitForChild("Camera")
game.Players.LocalPlayer.CameraMode = Enum.CameraMode.LockFirstPerson
camera.CameraType = Enum.CameraType.Scriptable
while true do
    if script.Parent.Head then
        camera.CFrame = CFrame.new(script.Parent.Head.Position)
    end
    task.wait()
end
thorny mason
sharp violet
#

yes

#

sup

thorny mason
#

Wait.

#

Did you Participate in the Game Jam.

#

?

faint coral
thorny mason
faint coral
#

when I try to set Camera.CFrame.Position it says it cant set CFrame.Position

sharp violet
faint coral
#

Imma try

faint coral
#

I do not really wanna use roblox default camera since it doesnt really work with my bone rig,

#

How can I make so when you move your mouse down(the mouse is in mouselock) a bone inside the player (spine2) rotates up and down, or just for now like make the mouse rotate the camera up and down when you move mouse up and down when the mouse is in mouselock

#

I have the camera as scriptable

thorny mason
#

This checks if the Mouse moved.

faint coral
#

I know, but I dont know how I can make the mouse make the camera go up and down

faint coral
#

and I want the mouse to be in mouselock also

#

and I wanna do this with a script, not lockfirstperson, i need custom camera

thorny mason
#

Wait. So if you want the Camera to moce you just gotta Change the Orientation of the Camera.

faint coral
#

yeah but how do I make the mouse move the camera?

#

like when the mouse goes up it moves the camera up

#

also to do this when the mouse is in mouselock

thorny mason
#

Oh you make a CFrame of the MousePosition and then Use CFrame.lookat().

faint coral
#

yeah and how do I make a cframe of the mouseposition? also it should only change from the mouse moving up and down for now

thorny mason
#

Wait rq.

faint coral
#

I managed to get the camera kinda-good ish now now I gotta fix camera movement

#

I'm gonna have the spine bone move with the camera

#

but I will have so if you look over a certain degree to the side then it rotates the whole character

#

Kind of like the fortnite movementsystem

thorny mason
#

This is the LocalScript:

Mouse = game.Players.LocalPlayer:GetMouse()

Mouse.Move:Connect(function()
    local Hit = Mouse.Hit
    game.ReplicatedStorage.MousePositionRemoteEvent:FireServer(Hit)
end)

This is the Script:

game.ReplicatedStorage.MousePositionRemoteEvent.OnServerEvent:Connect(function(Player, Hit)
    print(Hit.Position)
end)
#

This will get the MousePosition as a Cfarme.

faint coral
#

where do I put scripts?

#

so one local script and one script

#

should the script be server or client?

thorny mason
#

The LocalScript in StarterPlayerCharacter

faint coral
#

oki

thorny mason
#

The Script is Server-Sided.

faint coral
#

imma try

#

thx in advance

#

Nothing is happening, its not printing anything

#

oh wait nvm fixed it

#

I put the localscript inside camera, now I put it in its own script now its printing

faint coral
#

how can I make it work in mouselock?

thorny mason
#

Mouselocak is later.

#

For now just the CFrame.

faint coral
#

okay.

thorny mason
#

Wait.

#

Why Does that not work?

faint coral
#

It works

thorny mason
#

CurrentCamera = game.Workspace.Camera
CurrentCamera.CameraType = "Scriptable"
CurrentCamera.CFrame = script.Parent.CFrame

game.ReplicatedStorage.MousePositionRemoteEvent.OnServerEvent:Connect(function(Player, Hit)
print(Hit.Position)
script.Parent.CFrame = CFrame.lookAt(script.Parent.Position, Hit.Position)
end)

faint coral
#

I just did an error

thorny mason
faint coral
#

the script I use?

#

idk, it works now so imma let it be 💀

#

if it works dont touch it

#

hahaha

faint coral
#

Cause like I have seen other scripts in toolbox that does this

#

but they are for like menus

thorny mason
#

Make a Patr and Place the SCript inside it.

#

game.ReplicatedStorage.MousePositionRemoteEvent.OnServerEvent:Connect(function(Player, Hit)
print(Hit.Position)
script.Parent.CFrame = CFrame.lookAt(script.Parent.Position, Hit.Position)
end)

faint coral
#

part where?

thorny mason
#

WorkSpace.

faint coral
#

okay

#

just a part

#

what do I do now?

#

wth the part is moving around 💀

thorny mason
#

Anchor it.

faint coral
#

its still moving 💀

#

lemme try again

thorny mason
#

Huh.

faint coral
#

there we go

#

dayum thats cool

#

so now I just add that script into the spine/camer?

thorny mason
#

This is the localscript.

#

CurrentCamera = game.Workspace.Camera
CurrentCamera.CameraType = "Scriptable"
CurrentCamera.CFrame = game.Workspace.StartScreenCamera.CFrame

Mouse = game.Players.LocalPlayer:GetMouse()

Mouse.Move:Connect(function()
local Hit = Mouse.Hit
game.ReplicatedStorage.MousePositionRemoteEvent:FireServer(Hit)
CurrentCamera.CFrame = game.Workspace.StartScreenCamera.CFrame
end)

faint coral
#

where I put that?

thorny mason
#

StarterPlayerCharacter.

faint coral
#

New script or same?

thorny mason
#

Same.

#

Overwritte.

faint coral
#

I already set the camera type to scriptable

thorny mason
#

Yeah you can delet that PAret from the Script.

faint coral
#

and the thing is im setting the camera CFrame with another script

thorny mason
#

localscipt:
CurrentCamera = game.Workspace.Camera
CurrentCamera.CameraType = "Scriptable"
CurrentCamera.CFrame = game.Workspace.StartScreenCamera.CFrame

Mouse = game.Players.LocalPlayer:GetMouse()

Mouse.Move:Connect(function()
local Hit = Mouse.Hit
game.ReplicatedStorage.MousePositionRemoteEvent:FireServer(Hit)
CurrentCamera.CFrame = game.Workspace.StartScreenCamera.CFrame
end)

#

script:
game.ReplicatedStorage.MousePositionRemoteEvent.OnServerEvent:Connect(function(Player, Hit)
print(Hit.Position)
script.Parent.CFrame = CFrame.lookAt(script.Parent.Position, Hit.Position)
end)

#

Overwritte.

faint coral
thorny mason
faint coral
#

i just rename script to part

thorny mason
#

No the Part.

#

Oh ok.

faint coral
#

yh

#

yo dude

#

I have an issue

#

these "user_VW" , I dont even have that inside the game this is a completely new game

#

and I get that everytime I start in every game

#

aswell as these, "please give credit to speakerpro2"

thorny mason
#

Ist because of WaitForChild()

faint coral
#

no like I dont even have those assets in the game

#

I can make a new empty baseplate and all those still print

thorny mason
#

Huh.

#

Maybe a Plugin.

faint coral
#

its multiple things

thorny mason
#

Or you added the Wrong Free Model.

faint coral
#

I have no free models

#

it still happens in a completely empty baseplate

thorny mason
#

No like a FreeModel had a Virus Maybe.

faint coral
#

oh yh mbe

#

this happens

#

its super glitchy

thorny mason
#

Im not gonna open this then.

faint coral
#

oh hold on chec kDM

#

ohh wait

#

it should show as embed

#

ahh wrong file

#

there

#

no

#

wrong

#

@thorny mason

thorny mason
#

Yeah you can Tween that to make that More Smooth.

#

So.

faint coral
#

but its so glitchy tho

#

and also

#

I need to do this in mouselock

#

it gives this error

#

smth here

#

oh wait dude it says script.parent.CFrame inside CFrame

#

ahhh wait

#

Iwas supposed to remove teh serverscriptservice script

#

I found this old script I had

lament quartzBOT
#

studio** You are now Level 7! **studio