WeldConstraint Rotational Issue

My Code;

while true do
wait()
if script.Parent.Steer == 1 then
	[-- Line 5] script.Parent.Parent.RotationalTurn.Value.Part1 = script.Parent.Parent.RotationalTurn.Value.Part1 * CFrame.fromEulerAnglesXYZ(0,0.01,0)
elseif script.Parent.Steer == -1 then
	script.Parent.Parent.RotationalTurn.Value.Part1 = script.Parent.Parent.RotationalTurn.Value.Part1 * CFrame.fromEulerAnglesXYZ(0,-0.01,0)
end
end

My Error;

00:48:07.772 - Workspace.Battery.Kit.GunnerSeat.CS:5: bad argument #1 to '?' 
(CFrame expected, got Object)
00:48:07.772 - Stack Begin
00:48:07.773 - Script 'Workspace.Battery.Kit.GunnerSeat.CS', Line 5
00:48:07.773 - Stack End
00:48:14.518 - Disconnect from 127.0.0.1|59402

What I want it to do;
When D, or Steer == 1, and their respective counterparts are pressed, the part named “Rotate” should rotate, along with Turret, which is welded using a WeldConstraint. Now it just shows this error whenever I run, i’ve tried switching to weld and motor6d, but then the parts get moved when the welding happens. Here’s a video showing.
Edit: If more information is needed, I’ll provide.
https://youtu.be/Miyg3-XIHgE.

Well, I can tell you just by looking at the error that you’re trying to multiply the Object itself with a CFrame.

You need to access Part1’s CFrame property before multiplying the CFrame.

If you’re using an ObjectValue type object to reference a part. Try:
script.Parent.Parent.RotationalTurn.Value.CFrame = script.Parent.Parent.RotationalTurn.Value.CFrame * (Your CFrame)

(If you’re completely certain that the object will contain a “Part1” as a child. Then do .Value.Part1.CFrame)

3 Likes