So, basically I want to move the apples in a certain position when they’re moving up and down. I tried using TweenService for the apples to move up and down, but it won’t let the apples move to a random position. I also tried to loop through all the folder’s children and move the apple up and down, but it didn’t work.
How this basically works is, when a player touches an apple, the apple will move to a random position while moving up and down.
I have the apple model in ServerStorage, it will be cloned to the workspace later. Its parent is a folder, so right now there are multiple scripts. Each script is parented to one apple model, which is what I do not want. Since it’s unnecessary having multiple scripts. I wonder if there is another way to this, also a way that doesn’t reduce the performance.
This is my apple script that makes it move up and down without TweenService (So, it is not smooth).
while true do
for i = 1, 10, 1 do
script.Parent.PrimaryPart.CFrame *= CFrame.new(0, 0.1, 0)
task.wait(0.1)
end
for i = 1, 10, 1 do
script.Parent.PrimaryPart.CFrame *= CFrame.new(0, -0.1, 0)
task.wait(0.1)
end
end