Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Part not going in position?

Error in position

local part = Instance.new("Part",workspace)
local d = Instance.new("Decal",part)

part.TopSurface="Smooth"
part.BottomSurface="Smooth"
part.Anchored=true
part.Size=Vector3.new(5,5,1)
part.CFrame=CFrame.new(0,50,0)
part.Position=(0,0,0)

while wait() do
    part.CFrame = part.CFrame * CFrame.Angles(0,0,1/10)
end

4 answers

✓ Accepted answer

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:

local part = Instance.new("Part",workspace
local d = Instance.new("Decal",part)

part.TopSurface="Smooth"
part.BottomSurface="Smooth"
part.Anchored=true
part.Size=Vector3.new(5,5,1)
part.CFrame=CFrame.new(0,0,0)

while wait() do
    part.CFrame = part.CFrame * CFrame.Angles(0,0,1/10)
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

local part = Instance.new("Part",workspace
local d = Instance.new("Decal",part)
 
part.TopSurface="Smooth"
part.BottomSurface="Smooth"
part.Anchored=true
part.Size=Vector3.new(5,5,1)
part.CFrame=CFrame.new(0,50,0)
part.Position= CFrame.new(0,0,0)
while wait() do
    part.CFrame = part.CFrame * CFrame.Angles(0,0,1/10)
end

1 comment

0

This won't work. You're not accessing the CFrame property of "part", and you spelled CFrame with a lowercase "f".

This should work

local part = Instance.new("Part",workspace)
local d = Instance.new("Decal",part)

part.TopSurface="Smooth"
part.BottomSurface="Smooth"
part.Anchored=true
part.Size=Vector3.new(5,5,1)
part.CFrame=CFrame.new(0,50,0)
part.Position = Vector3.new(0,0,0)

while wait() do
    part.CFrame = part.CFrame+Vector3.new(0,0,1/10)
end

This discussion is preserved as it was. New answers, comments, and votes are closed.