Help with tween service

I am trying to move a humanoid model from 1 position to another using tween service. The distance between 2 positions is 8 studs. I want to achieve the closest speed to the actual Roblox player, which if I am not wrong is 16 studs per second. So, if I were to try and move the character, I would need tween to last only 0.5 seconds, right?

I just did not use tween service before, and only read the documentation.

1 Like

Yes. It would look something along the lines of

local TweenService = game:GetService("TweenService")
local tweenInfo = TweenInfo.new(0.5, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut)

local character = workspace.Character -- The humanoid model
local goal = CFrame.new() -- Whatever position you're trying to get character to

local tween = TweenService:Create(character, tweenInfo, {CFrame = goal})

On an unrelated note, the code I just provided is just to fulfill the minimum character requirement. I don’t actually know if it will work either.

1 Like

I am pretty sure that CFrame (the goal) should be replaced with Vector3. But In any way, thanks for confirmation!

That works too, as long as the propertyTable argument is changed to {Position = goal}. CFrame can only take in CFrames after all.

Or, you also could make a table from the start, because after all you are not restricted from making a table with just 1 key inside.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.