Position item in front of camera

I want the item to follow the camera but it’s just staying here and rotating with the camera. I want it to be like the player is holding the item.

video

rs.RenderStepped:Connect(function()
				item.Parent = workspace.CurrentCamera
				item.CFrame = workspace.CurrentCamera.CFrame + Vector3.new(1,0,0)
			end)

The offset I added is so that it is a little to the right of the camera like it’s being held in their right arm

1 Like

Maybe you could use a weld constraint to attach it to their hand? And then you could keep your current script for the rotation. :smile:

2 Likes

If I attatch it to their hand, wouldn’t the item just stay at their hand if they look up? I want it to move sort of like a viewmodel like this

The way I did it in this video was by having a part with an offset and I attatched the offsetted part to the camera, but I don’t wanna do that with every tool in the game

1 Like

Ahh I get it now. Unfortunately, I have absolutely no idea how to do that. I wish you good luck finding a solution though!

2 Likes

ur adding when u should be multiplying:

item.CFrame = workspace.CurrentCamera.CFrame * CFrame.new(1, 0, 0)
1 Like

the direction a CFrame is facing is called LookVector

so the point in front of the camera would be
camera.CFrame + (camera.Cframe.LookVector * distanceInFrontOfCamera)

where distanceInFrontOfCamera is the number of studs in front of the camera

1 Like

Thank you and @happya_x , what’s the difference between adding and multiplying the CFrame?

you cant do cframe + cframe, but you can do cframe + vector3

multiplying cframes is like adding two numbers

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.