I have this code
Part.Orientation.Y = theta2
And when I press play I get an error saying “Y cannot be assigned to”
theta2 is NOT nil
Part is NOT nil
Please help.
I have this code
Part.Orientation.Y = theta2
And when I press play I get an error saying “Y cannot be assigned to”
theta2 is NOT nil
Part is NOT nil
Please help.
Have you tried to use vector3?
Part.Orientation = Vector3.new(0, theta2, 0)
Try using the CFrame.Angles()
method.
local angle = CFrame.Angles(0, math.rad(90), 0)
local cframe = part.CFrame *= angle
See here for more info:
https://developer.roblox.com/en-us/api-reference/datatype/CFrame
Wait I just realized the problem: It wasn’t allowing my to change the Y value because of the rotation of the part, so I just set it to change the X value and it got fixed.
Oh ok, it was easier than I thought
We’re you in a rush? Because this is impossible.
What do you mean by “impossible”? That you can’t do that?
Wait, I’m an idiot I see what you mean… LOL
Part.Orientation = vector3.new(Part.Orientation.X,theta2,Part.Orientation.Z)
You can’t assign values to the components of a Vector3 value which describe a BasePart’s position/orientation, you need to construct a Vector3 value instead and assign that directly to the BasePart’s position/orientation property.
Is the correct solution.