How can I make this character controller in Roblox?

  1. I want to achieve a character controller system similar to this:
    https://www.youtube.com/watch?v=qdskE8PJy6Q&list=WL&index=35&t=323s

2.I’ve got the floating done and I just need to figure out how to calculate the movement like they did at 3:58 in the video(like the neddedAccel variable and other stuff).

  1. Heres my code currently(I want to rework it to be how it is in the video, just in roblox code):
	RunService.RenderStepped:Connect(function(delta)
		if self.MoveVector ~= 0 then
			self.MoveVector = Vector3.new(self.Humanoid.MoveDirection.X, 0, self.Humanoid.MoveDirection.Z)
			self.MoveDirection = Vector3.new(self.Humanoid.MoveDirection.X, 0, self.Humanoid.MoveDirection.Z) * (fps * delta) * self.Humanoid.Property.WalkSpeed
			self.Humanoid.CharacterController:ApplyImpulse(self.MoveDirection * self.Humanoid.Character.HumanoidRootPart.AssemblyMass)
			if self.MoveVector.Magnitude ~= 0 then
				self.Humanoid.CharAlignOrientation.CFrame = CFrame.lookAt(Vector3.zero, self.MoveVector)
			end
		end
	end)
1 Like