Is it possible to make slow motion

If it’s possible to make slow motion, where should i start, and how because I have no idea

8 Likes

It depends. Is your game multiplayer, or single player?

You should consult this article: AnimationTrack | Documentation - Roblox Creator Hub

It will allow you to change how quickly animations are performed, and hence extending their length. If you were to slow an animation down, it would seem like it’s going in slow motion! If you want to adjust things like falling, you can also control the gravity constants that Roblox has by seeing the Gravity attribute of the workspace data model.

Hope this helps,
-Tom :slight_smile:

1 Like

It is defnitely possible, however you have to remember to be careful with every aspect of your world, if you plan on doing slow motion. Also, the game has to be very very intriguing, if you want players to play it in slow motion. As someone else said, AniamtionTracks (using AdjustSpeed), and Gravity Constants are good ideas to mess around with. I would also recommend simply using certain things such as BodyMovers, if you want a less global (affecting only a few items or people instead of everyone) adjustment. Of course, here TweenService will be your best friend for environmental movement outside of the player.

I wish you a lot of luck :slight_smile:

1 Like

Consider what you have in your game. Are you tweening things over time? How many things are currently acted on by the physics system?

If you’re looking for something like Unity’s time scale functionality, you’ll need to write it yourself. Creating a NumberValue somewhere that clients can see it without modifying it will allow you to write your code in such a way that you can then use that NumberValue as a speed factor. However, if it’s being acted on by the physics system, there’s not much you can do to it. While you can try to reduce the gravity of Workspace (to simulate slowly falling,) you’d also need to reduce the JumpPower of Humanoids and figure out how to correctly make the lateral movement of objects become slowed.

So basically what im trying to do is like the victory royale 2 sec slow motion like in fortnite

I’d imagine you’d change the gravity a little bit:

local slowMo = false
slowMo = true

local speed = 1 / 2 -- 1 / 2 makes it slow down by 2 changing it to 2 would make it 2x faster

local gravity = workspace.Gravity

local objectTable = {}

local function toggleSlowMo(obj)
	if slowMo then
		if obj:IsA("Humanoid") or obj:IsA("AnimationController") then
			if obj:IsA("Humanoid") then
				obj.JumpPower = obj.JumpPower * speed
				obj.WalkSpeed = obj.WalkSpeed * speed
			end
			
			coroutine.wrap(function()
				while wait() and not slowMo do
					for _, loadedAnimation in ipairs(obj:GetPlayingAnimationTracks()) do
						loadedAnimation:AdjustSpeed(speed)
					end
				end
			end)()
			
			table.insert(objectTable, obj)
		end
		
		if obj:IsA("Sound") then
			obj.Pitch = obj.Pitch * speed
			table.insert(objectTable, obj)
		end
		
		workspace.Gravity = gravity * speed
	else
		if table.find(objectTable, obj) then
			if obj:IsA("Humanoid") or obj:IsA("AnimationController") then
				if obj:IsA("Humanoid") then
					obj.JumpPower = obj.JumpPower / speed
					obj.WalkSpeed = obj.WalkSpeed / speed
				end
				
				table.remove(objectTable, table.find(objectTable, obj))
			end
			
			if obj:IsA("Sound") then
				obj.Pitch = obj.Pitch / speed
				table.remove(objectTable, table.find(objectTable, obj))
			end
		end
		
		workspace.Gravity = gravity
	end
end

for _, obj in ipairs(workspace:GetDescendants()) do
	toggleSlowMo(obj)
end

workspace.DescendantAdded:Connect(function(obj)
	toggleSlowMo(obj)
end)

Then to undo it you would:

slowMo = false
for _, obj in ipairs(workspace:GetDescendants()) do
	toggleSlowMo(obj)
end
17 Likes