Okay, so I have a turret that is welded to another thing that can't be anchored for gameplay reasons. Originally my turret worked. What it does is you sit in a seat that makes you control a turret. It has a part that is welded to swivel of the turret. This moves to point where you click when you fire the turret. It also fires a laser beam and makes a ray. Everything worked perfectly until I welded the swivel to my hovering model that is not anchored. And when you use it makes the entire ship turn. Also, the main swivel part was anchored so it didn't move. I've tried to fix it and put in code that deletes the weld moves that part and then creates a new weld but nothing has made it work like it used to. I need some help Here's the code that's not working:

local swivel = script.Parent.Parent.Parent.TurretParts.Swivel
Weld.C1 = CFrame.new(MainPart.Position,ip.p) * CFrame.new(0,0,-MainPart.Size.Z/2)
MainPart.CFrame = CFrame.new(MainPart.Position,ip.p) * CFrame.new(0,0,-MainPart.Size.Z/2)
local weld = Instance.new("Weld")
weld.Part1 = MainPart
weld.Part0 = swivel
weld.C1 = MainPart.CFrame:inverse() * swivel.CFrame
weld.Name = "MainWeld"
weld.Parent = MainPart

Halp

2 comments

0

As reading your description i'd say dont use welds and just anchor everything, use models w/ Primarypart CFrame stuff.

0

It is on a hover thing that cant be anchored though