I cannot change a parts position

i cant change the parts position?
code

while true do
	if debounce == 0 then
		debounce = 1
		wait(1.5)
	script.Parent.Anchored = false
		wait(1.5)
		script.Parent.Anchored = true
		script.Parent.Position.X = 3.575
		script.Parent.Position.Y = 12.041
		script.Parent.Position.Z = -40.556
		debounce = 0
		end
end

You can’t set position with Position.X rather do this:


while true do
	if debounce == 0 then
		debounce = 1
		task.wait(1.5)
	script.Parent.Anchored = false
		task.wait(1.5)
        script.Parent.Anchored = true
        script.Parent.Position = Vector3.new(3.575, 12.041, -40.556)
		debounce = 0
	end
end

Does that work now, last time I tried something like that I got an error saying something like cannot set property Y of Position

1 Like

I cant help but mention that youre being a little extra with the whole “debounce” thing.

If you want to move a parts location one time:

You do not need any waits() because your calling it to move once
You do not need a loop because youre moving the part once
You do not need to unanchor a part to move it because position is a property that part reads from. Changing a position will not go through the physics engine, rather the physics engine will read off the parts position

part.Position = Vector3.new(x,y,z)

Vector3 is a special datatype that is used to represent space in various ways. There are probably many better explanations on vectors online as opposed to what I could give you.

1 Like

They apparently changed it, sadly…

1 Like

Yea I am aware of that as I use it all the time for setting positions of other objects relative to a different part

1 Like

Its been that way for as long as I can remember… like at least 3 years

1 Like

forgot context, its going to be rolling and waiting in between rolls