I’m trying to make it so that when you press F a lantern shows up in a ViewportFrame, but for some reason if I try to weld the lantern to the fake arm it just doesnt move.
I’m currently having a different issue. I want to use an AlignPosition object to constantly move the arm in front of the camera, but for some reason the position of it doesnt change.
game:GetService("RunService").RenderStepped:Connect(function()
if not lanternequipped then
bodypos.Position = Vector3.new(cam.CFrame.Position + Vector3.new(1.25,-3,-1.5))
bodygyro.CFrame = CFrame.Angles(math.rad(-80),math.rad(-30),math.rad(60))
print("lantern unequipped")
print(bodypos.Position)
else
bodypos.Position = Vector3.new(cam.CFrame.Position + Vector3.new(1.25,-0.75,-1.5))
bodygyro.CFrame = CFrame.Angles(math.rad(-60),math.rad(-10),math.rad(30))
print("lantern equipped")
print(bodypos.Position)
end
end)
I tried the exact same thing without a script on the workspace and worked perfectly fine. I’m assuming its a problem on the client or something related
ViewportFrames do not have physics (i.e. things that rely on velocity to move other things, like AlignPosition or AlignOrientation, or any of the body movers for that matter), the closest you have is putting everything under a WorldModel under the ViewportFrame, but that only lets you use joints (animatable Motor6Ds, welds etc).
Speaking of WorldModels, that is exactly what you need to use WeldConstraints in ViewportFrames.
Alright so it took me a couple hours and I completely had to remake everything, not really a solution because what I mentioned isn’t possible with a ViewportFrame, but what you said was a great alternative. I’m gonna mark it as a solution.
To explain ‘ViewportModel’ instances don’t support physics (this includes ‘JointInstance’ instances, i.e; ‘Weld’, ‘Glue’, ‘Snap’ etc.). ‘WorldModel’ instances are required in order for physics to be simulated inside ‘ViewportModel’ instances.
I wish I had known that 2 years ago. But as the “solution” said, the light from the viewport won’t affect the workspace so yeah it’s not really the optimal solution