CFrame and Vector3 won't add up, no errors

Tried making a custom headless first-person (because reasons), and there is a problem.

Concept:
-Make fake head
-Weld it to the head
-Offset it
-Set camera to said fake head

Expectation (red is the fake head):
image

What happened:
image

The issue is that the CFrame + Vector3 does nothing.

wait(1)
FakeHead = Instance.new("Part",script.Parent)
FakeHead.Size = Vector3.new(.1,.1,.1)
FakeHead.Name = "FakeHead"
FakeHead.CanCollide = false
Instance.new("Weld",FakeHead)
FakeHead.Weld.Part0 = FakeHead
FakeHead.Weld.Part1 = script.Parent.Head
FakeHead.CFrame = script.Parent.Head.CFrame + Vector3.new(1,0,0) --issue here
workspace.Camera.CameraSubject = FakeHead
script.Parent.Head.Transparency = 1
script:Destroy()

Any help is appreciated.

Look, do CFrame = CFrame.new(position,orientation)

What do you mean?
CFrame is a weakpoint for me.

Are you trying to get the player’s head, set it to transparent. Then create a fake head and move it that position? CFrame + Vector3 should work fine.

I already did that in another script. The FakeHead is just a local part (called by client) so the camera can focus on it. (otherwise it would be looking at his back)

If you want the FakeHead to be infront of the actual head, use CFrame * CFrame instead, with the -Z value.

wait(1)
FakeHead = Instance.new("Part",script.Parent)
FakeHead.Size = Vector3.new(.1,.1,.1)
FakeHead.Name = "FakeHead"
FakeHead.CanCollide = false
Instance.new("Weld",FakeHead)
FakeHead.Weld.Part0 = FakeHead
FakeHead.Weld.Part1 = script.Parent.Head
FakeHead.CFrame = script.Parent.Head.CFrame * CFrame.new(0,0,-1.5)
workspace.Camera.CameraSubject = FakeHead
script.Parent.Head.Transparency = 1
script:Destroy()

Another thing that might be causing this is the Weld you set up. If above doesn’t help you, try using a WeldConstraint instead.

wait(1)
FakeHead = Instance.new("Part",script.Parent)
FakeHead.Size = Vector3.new(.1,.1,.1)
FakeHead.Name = "FakeHead"
FakeHead.CanCollide = false

local Weld = Instance.new("WeldConstraint")
Weld.Part0 = FakeHead
Weld.Part1 = script.Parent.Head
Weld.Parent = FakeHead

FakeHead.CFrame = script.Parent.Head.CFrame * CFrame.new(0,0,-1.5)
workspace.Camera.CameraSubject = FakeHead
script.Parent.Head.Transparency = 1
script:Destroy()
1 Like

That was it.
My brain is slow rn.
The content of the image, i can fix. That was just me being dumb.
image
Marked as solution, and thank you.

1 Like