How to tween a Parts Position and Rotation at once?

Hello! I currently have an arrow system for an obby I’m working on and I made it to where once you reach another checkpoint the previous arrow disappears and then the next one appears, but I wanted to make this a bit better.

Let me show you an example of what I want to achieve:

image
So on the left is block 1, and on the right is block 2.
So how can block 1 rotate and tween at the same time smoothly to block2? This is a concept of mine:

local Block1 = game.Workspace.Block1
local Block2 = game.Workspace.Block2
Block1:TweenPositionAndRotation(Block2.Position, Block2.Rotation)
1 Like

Use TweenService and tween its CFrame property or its position and orientation properties.

https://developer.roblox.com/en-us/api-reference/class/TweenService

You should use CFrame because CFrame contains both the position and the rotation of the part. Here’s an example code:


-- services --

local tweenService = game:GetService('TweenService')

-- constants --

local PART_1 = workspace.StartPoint
local PART_2 = workspace.EndPoint 
local TWEEN_INFO = TweenInfo.new(1, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut)

-- tween --

local TWEEN = tweenService:Create(PART_1, TWEEN_INFO, {CFrame = PART_2.CFrame)
TWEEN:Play()
1 Like