Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I add orientation to this script?

Asked by 3 years ago

I asked a question about CFrame movement and was kindly provided with this script:

local TweenService = game:GetService("TweenService") --gets tween service

local part = workspace.Part --gets the part (change it to your own part's address)

local tweenInfo = TweenInfo.new( --how we want our tween to play
    1, --how fast the tween is (in seconds)
    Enum.EasingStyle.Linear, --easing style
    Enum.EasingDirection.Out, --easing direction
    0, --no. of times the tween will repeat
    false, --will the tween reverse upon finishing?
    0 --how long the delay is (in seconds)
)

local goal = { --goal for our part's property, in this case, the position
    Position = Vector3.new(69,42,0) --our goal position for our part
}

local tween = TweenService:Create(part, tweenInfo, goal) --now creates the tween

tween:Play() --finally, plays it

However, me not being very strong with Lua, I can't figure out how to add orientation to this. Does anyone know if it's possible and/or provide a script?

0
If my answer helped you please let us know or other people won't know wether this is the answer to their similar questions or not. JayShepherdMD 147 — 3y

1 answer

Log in to vote
1
Answered by 3 years ago

Under the goal property put the orientation there.

It reads.

local goal = { --goal for our part's property, in this case, the position.

        Position = Vector3.new(69,42,0) --our goal position for our part
        Orientation = Vector3.new(1,-1,0) -- our goal orientation for our part

    }

Hope this helps.

0
Im testing this out in studio right now... wwwaylon09 113 — 3y
0
Problem. I got an error: Workspace.TestPart.Script:17: Expected '}' (to close '{' at line 14), got 'Orientation' wwwaylon09 113 — 3y
0
Thanks! I solved it by putting a ; wwwaylon09 113 — 3y
Ad

Answer this question