Help making a physics lantern

im really bad at explaining stuff but ima try me best,

so, using a script you can change the cframe of the lantern model to match the handles cframe

ex script:

local tool = script.Parent :: Tool -- the equipped tool

local handle = tool.Handle :: BasePart -- the object you hold onto
local lantern = tool.Lantern :: Model -- the model of your lantern

--when the tool is equipped
tool.Equipped:Connect(function(Player : Player)
	lantern:PivotTo(handle.CFrame)
end)
1 Like

interesting results

do you have a primary part set on the model in its properties

and if so, the rotation is due because the orientation of the handle and lantern primary part aren’t facing the same direction

we can account for this by only setting the lanterns position and keep its orientation the same

updated script:

local tool = script.Parent :: Tool -- the equipped tool

local handle = tool.Handle :: BasePart -- the object you hold onto
local lantern = tool.Lantern :: Model -- the model of your lantern

--when the tool is equipped
tool.Equipped:Connect(function(Player : Player)
	lantern:PivotTo(CFrame.new(handle.Position,handle.Position+lantern.PrimaryPart.CFrame.LookVector))
	--[[
		lantern.PrimaryPart.CFrame.LookVector is the direction the lantern is facing, we can
		use this to make the position goto the handles position while looking towards the
		lanterns orginal front orientation
	--]]
end)

--edited

this works, but its more jumpy than id like it to be

after experimenting with this, this is happening because of rodConstraint, when the length is too low, it starts to move weird.

i would suggest switching from rodConstaints to ballSocketConstraints

1 Like

the lantern moves much better now, but it moves erratically and VERY slowly, as if in low gravity
model if you need it
lantern.rbxm (14.0 KB)

If you want to simulate gravity but dont want to turn massless on, you could keep it massless but insert a force constraint moving downwards relative to world space.

Newlantern2.rbxm (14.0 KB)

heres a updated version of the model, should be working now

i changed some of the properties for the ball socket and slightly moved the attachment down to give the model some room to move properly

1 Like

tysm for your help! any way i can keep the lantern from going fully above the handle?

the best thing id think to do is to keep experimenting with the limits properties

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