How do I get a part to move

I tried to make a script to move an object, but it isn’t working. I don’t know what is wrong. It just wont move at all

It looks like you forgot a +

while wait(0.01) do
script.Parent. Position = script.Parent. Position+Vector3.new(-1,0,0)
end

thx dude, ill check to see if this fix works

It didn’t work, I’m going to try a different way to code it and I will tell you if it works.

What does the output error said?

Try looking at Tweening! It’s a better way to move objects without cluttered loops.
TweenService and Tweens
You can also change much more than position with Tweening, including rotation.
If you need any help understanding it i can help!

Ok, I’ll check it out, thx. I’ll tell you how it goes.

1 Like

I think I just figured it out. I had to recode it in a different way. The original error said something about Position not being a valid thing.

Yep! I think you tried to move a model, not a BasePart.

I found out how to do it this way. I am not sure what it is called, but it works.

Cool! I hope you can create the game you now want to! (Although, for raising lava like it seems you are trying to do, i’d still recommend TweenService.)

thx man. I just wanted to move it over the x axis so someone can jump over it.

2 Likes