Error in position
01 | local part = Instance.new( "Part" ,workspace) |
02 | local d = Instance.new( "Decal" ,part) |
03 |
04 | part.TopSurface = "Smooth" |
05 | part.BottomSurface = "Smooth" |
06 | part.Anchored = true |
07 | part.Size = Vector 3. new( 5 , 5 , 1 ) |
08 | part.CFrame = CFrame.new( 0 , 50 , 0 ) |
09 | part.Position = ( 0 , 0 , 0 ) |
10 |
11 | while wait() do |
12 | part.CFrame = part.CFrame * CFrame.Angles( 0 , 0 , 1 / 10 ) |
13 | end |
Lol, this was from my math.random explanation. But anyway, you need to change the value to either a Vector3, or a CFrame. If you're changing it to a CFrame, you'll need to access the CFrame property of the part.
Here:
01 | local part = Instance.new( "Part" ,workspace |
02 | local d = Instance.new( "Decal" ,part) |
03 |
04 | part.TopSurface = "Smooth" |
05 | part.BottomSurface = "Smooth" |
06 | part.Anchored = true |
07 | part.Size = Vector 3. new( 5 , 5 , 1 ) |
08 | part.CFrame = CFrame.new( 0 , 0 , 0 ) |
09 |
10 | while wait() do |
11 | part.CFrame = part.CFrame * CFrame.Angles( 0 , 0 , 1 / 10 ) |
12 | end |
TheDeadlyGuest4 said something similar, but his example was flawed with a lowercase "f" in "CFrame", and not changing the "part.Position" to "part.CFrame".
Does the part spawn in the middle? If so, Its because your position is set 0 0 0 which is in the middle of the baseplate for example, I can help you more if you give me more detail on how it is erroring.
You need to use vector3.new or CFrame.new
01 | local part = Instance.new( "Part" ,workspace |
02 | local d = Instance.new( "Decal" ,part) |
03 |
04 | part.TopSurface = "Smooth" |
05 | part.BottomSurface = "Smooth" |
06 | part.Anchored = true |
07 | part.Size = Vector 3. new( 5 , 5 , 1 ) |
08 | part.CFrame = CFrame.new( 0 , 50 , 0 ) |
09 | part.Position = CFrame.new( 0 , 0 , 0 ) |
10 | while wait() do |
11 | part.CFrame = part.CFrame * CFrame.Angles( 0 , 0 , 1 / 10 ) |
12 | end |
This should work
01 | local part = Instance.new( "Part" ,workspace) |
02 | local d = Instance.new( "Decal" ,part) |
03 |
04 | part.TopSurface = "Smooth" |
05 | part.BottomSurface = "Smooth" |
06 | part.Anchored = true |
07 | part.Size = Vector 3. new( 5 , 5 , 1 ) |
08 | part.CFrame = CFrame.new( 0 , 50 , 0 ) |
09 | part.Position = Vector 3. new( 0 , 0 , 0 ) |
10 |
11 | while wait() do |
12 | part.CFrame = part.CFrame+Vector 3. new( 0 , 0 , 1 / 10 ) |
13 | end |