#why this won't work?

63 messages · Page 1 of 1 (latest)

harsh comet
modern quartz
#

is the tween2 not playing at all?

harsh comet
#

no playing at all

#

the platform just stay here

#

ohhh i think ik

#

uh no

harsh comet
#
local tweenservice = game:GetService("TweenService")

local movingplatform = workspace:WaitForChild("movingplatform")
local pos1 = workspace:WaitForChild("movingpart11")
local pos2 = workspace:WaitForChild("movingpart22")

local info = TweenInfo.new(4,Enum.EasingStyle.Linear,Enum.EasingDirection.In,0,false,2.5)

local tween = tweenservice:Create(movingplatform,info,{CFrame=pos1.CFrame})
local tween2 = tweenservice:Create(movingplatform,info,{CFrame=pos2.CFrame})

task.wait(2.5)

tween:Play()

task.wait(5)

tween2:Play()

modern quartz
#

thx

vast mountain
#

what do you want make with it

#

is it like

#

moving platform

#

to one position then to back?

#

answer!!!

#

:(

harsh comet
vast mountain
#

Ok

harsh comet
#

go to a position wait 5 sec go back wait 5 sec repeat inf

vast mountain
#

ok

harsh comet
#

so reverse cannot be used cause it don't stop

vast mountain
#

i think

modern quartz
#

just to be sure pos1 isnt where you are starting

harsh comet
#

pos 1 is start

#

pos 2 is end

modern quartz
vast mountain
#

why tween playing first

#

then

modern quartz
#

the problem is that you are playing tween 1 first and it is setting itself to its starting position

#

so it isnt moving

#

other than that everything else works

harsh comet
#

so this work but don't work

#

stopping here

#

and going back

#

wait

modern quartz
#
local tweenservice = game:GetService("TweenService")

local movingplatform = workspace:WaitForChild("movingplatform")
local pos1 = workspace:WaitForChild("movingpart11")
local pos2 = workspace:WaitForChild("movingpart22")

local info = TweenInfo.new(4,Enum.EasingStyle.Linear,Enum.EasingDirection.In,0,false,2.5)

local tween = tweenservice:Create(movingplatform,info,{CFrame=pos1.CFrame})
local tween2 = tweenservice:Create(movingplatform,info,{CFrame=pos2.CFrame})

task.wait(2.5)

tween2:Play()-- just swap the two tweens

task.wait(5)

tween:Play()
#

make tween 2 play first, then 1

harsh comet
#

i did it

modern quartz
#

does it work?

harsh comet
modern quartz
#

or other way around

vast mountain
#

maybe task.wait(5) is not enough? frfr

harsh comet
#

yes

vast mountain
#

lol you can calculate the time

#

and change it

harsh comet
#

6.5

vast mountain
#

(movingplatform.Position - pos1.CFrame).Magnitude / 4

#

oh

harsh comet
#

yay this work

modern quartz
#

sick

harsh comet
#

now i will do a while loop

vast mountain
#

also

#

btw

#

you could just use

#

tween.Completed:Wait()

#

instead of task.wait()

#

oh wait

#

nvm

#

u waiting 5 secs

harsh comet
#

while true do

tween2:Play()

task.wait(6.5)

tween:Play()

task.wait(6.5)

end

wicked laurelBOT
#

studio** You are now Level 4! **studio