Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do I add orientation to this script?

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?

1 comment

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.

1 answer

✓ Accepted answer

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.

3 comments

0

Im testing this out in studio right now...

0

Problem. I got an error: Workspace.TestPart.Script:17: Expected '}' (to close '{' at line 14), got 'Orientation'

0

Thanks! I solved it by putting a ;

This discussion is preserved as it was. New answers, comments, and votes are closed.