#I dont know why it doesnt work

60 messages · Page 1 of 1 (latest)

velvet tartan
#

Simple tweenservice code : ```lua
local ts = game:GetService("TweenService")
local part = script.Parent
local tinfo = ts.new(1)

local goal = {Position = Vector3.new(2,2,2)}
local t = ts:Create(part, tinfo, goal)
t:Play()```

hidden latch
#

ur supposed to use
TweenInfo.new()

velvet tartan
#

oh

velvet tartan
hidden latch
#

what is it

velvet tartan
#

I have a code

#

like this

#
local TweenService = game:GetService("TweenService")
local frame = game.Workspace.RustyOven.Door:WaitForChild("Frame")

local tweenInfo = TweenInfo.new(2)
local goal = {
    Position = Vector3.new(5,5,5)
}

print("jc")```
hidden latch
#

oh

#

for gui

velvet tartan
#

i used a print statement to debug

hidden latch
#

u need to use Udim

velvet tartan
#

its not for gui

#

its just the part named rame

#

frame*

hidden latch
#

oh wait mb

velvet tartan
hidden latch
#

do u get any errors?

velvet tartan
#

no

#

the script doesnt seem to run at all

hidden latch
velvet tartan
#

Now it works for some reason?

velvet tartan
#

uh

hidden latch
velvet tartan
#

local tween = TweenService:Create(frame, tweenInfo, goal)

when i add that it doesnt work

#

and ofc when i try to play the animation it doesnt work

hidden latch
#

weird since I copied your script and it works fine for me

#

do u get any errors after playing the tween?

velvet tartan
#

i asked chatgpt cuz its ananoying me and he gave me this

local TweenService = game:GetService("TweenService")
local frame = game.Workspace.RustyOven.Door:WaitForChild("Frame") -- Assuming 'Frame' is a part.

-- TweenInfo (2 seconds duration)
local tweenInfo = TweenInfo.new(2)

-- Correct 'CFrame' for physical objects
local goal = {
    CFrame = CFrame.new(5, 8, 8) -- Target position in world space
}

-- Create and play the tween
local tween = TweenService:Create(frame, tweenInfo, goal)
tween:Play()

print("Tween started successfully!")```
hidden latch
#

does it work?

velvet tartan
#

it uses CFrame

#

idk whats the diff between cframe and vector3

tawdry mistBOT
#

studio** You are now Level 3! **studio

hidden latch
#

CFrame is like a diffrent way of positioning objects

#

cool that it works but no idea why it didnt work with Position

velvet tartan
hidden latch
#

@velvet tartan wait one question

#

is the door a part?

velvet tartan
#

?

#

its a model made of a mesh and a part

hidden latch
#

ohh now I know

#

it doesnt work

velvet tartan
#

why?

hidden latch
#

because u cant position models using Position, u need to use CFrame for models

velvet tartan
#

oh

#

what about rotation

#

?

#

cuz im trying to rotate the door of the oven

hidden latch
#

u need

#

to use

#

CFrame to change the rotation as well

#

u gotta do something like this
CFrame = CFrame.new() * CFrame.Angles

velvet tartan
#
local TweenService = game:GetService("TweenService")
local ovenDoor = script.Parent.Parent.Parent.Parent:WaitForChild("Door")

local twinInfo = TweenInfo.new(1, Enum.EasingStyle.Sine)
local goal = {
    CFrame = CFrame.new(5, 20, 7)
}

local tween = TweenService:Create(ovenDoor, twinInfo, goal)
tween:Play()```
ovenDoor is a model of a mesh and a glass part, why isnt it working?
hidden latch
#

also when ur using CFrame.Angles u should use math.rad()