I have a mesh part(Imported from blender) and I would like to get it to move in a sequence. EG: Its a Pet, I would like the pet to move forward, turn around and come back to starting position. I have all the animations already and i know how to get them to work, I just can’t seem to get the pet to move at all.
I am using scripts to get the part to move, im a new scripter, so im applying the same logic as moving a part, and applying it to the mesh. but nothing is happening.
local part = script.Parent
local startPosition = part.Position
local distance = 5 – Change this value to adjust the horizontal distance of the movement.
local speed = 1 – Change this value to adjust the speed of the movement.
while true do
local currentTime = tick()
part.Position = startPosition + Vector3.new(math.sin(currentTime * speed) * distance, 0, 0)
wait(0.1) – Adjust the wait time to control the smoothness of the movement.
end