#My Tween does not work.

1 messages · Page 1 of 1 (latest)

jagged axle
#

local tweenservice = game:GetService("TweenService")
local part = script.Parent

local tweeninfo = TweenInfo.new(15)

local goal = {
Position = Vector3.new(1, 0, 0),
Size = Vector3.new(10, 10, 10)
}

local tween = tweenservice:Create(part, tweeninfo, goal)

task.wait(2)
tween:Play()

#

I want to make the size biggerr, and also move position, but it doesnt work

rich storm
#

Didn't put enough into the tween info

jagged axle
#

Can you help me?

sly pewter
#

Are you having any errors

#

And make sure your part isn't already in that position and that size or close to it

#

AS your tween is 15 seconds it would change very slowly meaning if your part was 9,9,9 in size you would maybe barely notice the difference

#

besides that i don't see anything wrong unless you have any errors

jagged axle
#

Also

#

the size doesnt even change

#

Oh

#

wait

#

Lemme try again

#

Oh

#

the error was

#

not error

#

but problem

#

was that my part was already bigger than 10,10,10

#

@sly pewter

sly pewter
#

Oh alright

#

So it works now?

jagged axle
#

Ye

#

wait

#

but are Position and Size

#

roblox's properties?

#

or was it a name for variable?

#

those belong in the tweenInfo right?

#

@sly pewter

#

Also i am just learning tweenservice rn

#

What do the 3 parameters mean in Position?

#

The thing only moves in one direction regardless of what I put in position

sly pewter
sly pewter
jagged axle
#

But why can't i tween it up

#

I do 0, 1 , 0

#

and it doesnt work

sly pewter
#

try a higher value

#

like 0.6.0

#

0,6,0*

#

See if that works'

jagged axle
#

It moves diagnally

#

diagonally

#

still

sly pewter
#

Do you want it to move up no matter where it is

#

Or do you want it to move to a certain position

jagged axle
#

oh

#

no matter where it is

#

Isn't thjat what vector3.new

#

is

sly pewter
#

Okay i'm really bad at explaning so i'll try to explain then just give you the script

jagged axle
#

Ok

#

Thx

sly pewter
#

So when you set the position normally you are just moving it to a place in the workspace

#

So if your part is at 0,0,0

#

And you tween the position to 0,1,0

#

It will move upwards by 1

jagged axle
#

Ok

#

I get it

sly pewter
#

But if your part is at something like 3,2,5 (away from the centre of the world)

#

and you tween it to 0,1,0

jagged axle
#

it will just move back ye

sly pewter
#

It will go to the same position as the previous one

#

yeah

jagged axle
#

i want it to be no matter where

sly pewter
#

So you need to get the current position of the part

#

and then ADD the vector you want to move it by

jagged axle
#

oh

sly pewter
#

So the part where you have position

jagged axle
sly pewter
#

You can make a variable first

jagged axle
#

what would i add

sly pewter
#

Called InitialPosition

jagged axle
#

local current = part.Vector3?

sly pewter
#

Just before goal

jagged axle
#

like that?

#

oh

sly pewter
#

part.Position

jagged axle
#

Ok

sly pewter
#

current = part.Position

#

then inside the goal

jagged axle
#

ok

#

Wait

#

local?

sly pewter
#

Yeah

jagged axle
#

Ook

#

then

sly pewter
#

inside the goal table

jagged axle
#

Position = InitialPosition + Vector3.new

#

?

sly pewter
#

Yes

jagged axle
#

omg

#

ty

#

I am just experimenting

#

to learn rn

#

but thx

sly pewter
jagged axle
#

wat

#

wait

sly pewter
#

Hope everything goes well for you

jagged axle
#

is there any other terms like Position or size

#

for tweening

sly pewter
#

Yes there are a lot

jagged axle
#

ye

sly pewter
#

color

#

wait

jagged axle
#

ok

#

But i have to use those exact terms rightr?

sly pewter
#

Do you have the explorer tab open

jagged axle
#

ye

#

I go into properties right?

sly pewter
sly pewter
jagged axle
#

ohh

sly pewter
#

you can see everything that is in there, if it makes sense to tween then you can

jagged axle
#

So what is the benefit of twening

#

in comparison

#

to

#

just doing x position plus 1 plus 1 over and over again

sly pewter
#

For example you have tweenstyles (i think they are called that)

jagged axle
#

ohh

sly pewter
#

you can make it linear like it already is

#

or you can make it exponetial which starts of slow then builds up speed

#

or you could make it bounce into place

#

etc

jagged axle
#

oh

#

is that easing?

sly pewter
#

yeah

#

easingstyle

#

my fault^

jagged axle
#

oh ye

#

wait

#

why is this red?

#

I want it to go up for 1 second

#

then left again

sly pewter
#

Oh, well first you would need a coma when you add things to a table, but this isn't the correct way to do it

#

comma*

jagged axle
#

o

#

alr

sly pewter
#

you would have to create another tween and different tween info

jagged axle
#

Got it

#

wait

sly pewter
#

and then you put the wait inbetween the tweens

jagged axle
#

so do i just do another tweenInfo

sly pewter
#

yeah

jagged axle
#

but different local variablename?

sly pewter
#

wait no

#

you don't have to change the tweeninfo

#

just the goal

jagged axle
#

o

sly pewter
jagged axle
#

ok

sly pewter
#

different name

#

for the tween

#

so you would have goal and goal1

jagged axle
#

ok

sly pewter
#

and then tween and tween1

jagged axle
#

so now this

sly pewter
#

or whatever is better for you

jagged axle
#

a new* this

sly pewter
#

yeah

jagged axle
#

and a different goal

#

WAIT

sly pewter
#

and a new goal yeah

normal heronBOT
#

studio** You are now Level 7! **studio

jagged axle
#

So i can call different goals

sly pewter
jagged axle
#

easily

#

ok

#

So i can make one goal for sizing and one goal for position

#

ok

sly pewter
#

yeah but uh

#

it only takes one table

jagged axle
#

wait what

sly pewter
#

so you would have to have them as normal variables

sly pewter
jagged axle
#

o

#

ok

sly pewter
#

continue what you were doing i dont want to confuse you

jagged axle
#

lemme send my code

sly pewter
#

but ill explain if you get it wrong

sly pewter
jagged axle
#

why is it red

sly pewter
#

change tween to tween1

jagged axle
#

h

#

oh

#

mb

#

wait it just doesnt work

sly pewter
#

you are setting the same goal

jagged axle
#

bruh

sly pewter
#

so they both do the same thing

jagged axle
#

ok

#

i keep making easy mistakes

#

wait'

#

still doesnt work

sly pewter
#

wait

#

are you trying to make it

#

wait 3 seconds

#

between both tween1 and tween2

jagged axle
#

Um

#

Ye

sly pewter
#

yeah dont add it in the table

jagged axle
#

Oh ok

sly pewter
#

that table is only for things you want to change

jagged axle
#

Ok

sly pewter
#

put it after tween1:Play()

jagged axle
#

Ok

#

ohh

#

it works

#

wait

#

why does wait(3) work but not task.wait(3)

sly pewter
#

they should both work thats weird

jagged axle
#

o

#

it wors anyway tho

#

thx

sly pewter
#

np

jagged axle
#

wait

#

So my TweenInfo.new(1) means it lasts 1 second right?

sly pewter
#

Yes

jagged axle
#

So how do i make one of them last 1 second, but another last different?

sly pewter
#

you wuld make to make different tween info for them

#

so you can do the same thing you did with the tweens

#

tweeninfo1

#

tweeninfo2

jagged axle
#

oh ok

#

thx

jagged axle
#

Yo @sly pewter

#

how long have you been scripting?

sly pewter
#

To be honest I don't really know

#

It's kinda of an on and off thing

#

But I'd say seriously for a year

#

And started like 4 years ago maybe

jagged axle
#

Oh alr

normal heronBOT
#

studio** You are now Level 7! **studio

cold nimbus
#

except u want different time tweens

#

because you can tween every property of an part in just 1 tween

#

thats why its an table

sly pewter