when I heard that a lot of popular games use parts instead of Roblox’s inbuilt movement system to have more flexibility, I was intrigued.
I was gonna make something similar but I have no clue where to start
when I heard that a lot of popular games use parts instead of Roblox’s inbuilt movement system to have more flexibility, I was intrigued.
I was gonna make something similar but I have no clue where to start
just set player character to nil and set camera type to scriptable used by the client then program the movement control if the user uses wasd keys or arrow keys to move and program the camera to follow the camera and can be zoomed in and out by the player
you should just use humanoid because it overall has better movement controller for certain reasons
also where did you get that information that “popular games” use custom movement controllers
This isn’t working code, but here is like a base you want to start off.
-- Obviously want to require some necessary services.
local UIS = game:GetService("UserInputService") -- You can also use the new input thingies, I haven't messed around with them much yet.
local RunService = game:GetService("RunService")
-- then variables
local movementDirection = Vector3.new() -- You pretty much want a direction to move in World Coordinates.
local Jump = false -- Jump trigger variable to tell our code to jump.
local Root = somecharactermodel.Root -- Pretty much the part that all our character models and stuff hook to with welds or Motor6D's.
UIS.InputBegan:Connect(function(inp)
if inp == Enum.KeyCode.W then
movementDirection += Vector3.new() -- The direction it moves, we add it so we can stack it.
elseif inp == Enum.KeyCode.A then
movementDirection += Vector3.new()
elseif inp == Enum.KeyCode.S then
movementDirection += Vector3.new()
elseif inp == Enum.KeyCode.D then
movementDirection += Vector3.new()
elseif inp == Enum.KeyCode.Space then
Jump = true
end
end)
UIS.InputEnded:Connect(function()
if inp == Enum.KeyCode.W then
movementDirection -= Vector3.new() -- Then reverse it
elseif inp == Enum.KeyCode.A then
movementDirection -= Vector3.new()
elseif inp == Enum.KeyCode.S then
movementDirection -= Vector3.new()
elseif inp == Enum.KeyCode.D then
movementDirection -= Vector3.new()
end)
-- Then have like a loop, I like using Stepped because we're moving a physics character. Might as well sync it to the Physics Tick.
RunService.Stepped:Connect(function()
if Jump then
Jump = false
Root:ApplyImpulse(Vector3.new(0,1 * Root.Mass * 50,0)) -- Example something to jump N stuff.
end
if movementDirection != Vector3.new() then -- Checks if movementDirection isn't equal to Zero.
Root.CFrame += CFrame.new(movementDirection)
end
end)
Obviously this isn’t ready for straight copy and paste but for you to just know the base where you should start. Start with inputs first, then do the physical movement, then do the Raycasting and Physics and all that and also Networking to other players. There’s more but it will fill this whole Forum up.
It’s much easier to just use Humanoid as a base like @Godzilla_RealLife said for the actual player then just disable PlayerControls and make your own Controller. That is what most popular games do so they can control it more. If you have no reason to make your own controller then just don’t do it.
I spoke with the owner of a decently large game about movement controllers, he explained to me that a lot of fast pace movement games use a custom controller to gain more control over certain things (wallrun, friction etc.)
appreciate it! I’ll see what I can do:)