How to Actually Use Roblox's Physics Character Controllers

Yeah thats crazy! I just found about them and they quickly fixed the problem i had for days…

1 Like

You can use Humanoid:ChangeState(Enum.HumanoidStateType.Dead)

2 Likes

Thanks! I appreciate your help!

1 Like

I agree, hopefully more people start to use these because of the new Platformer template

1 Like

Im making a parkour game but i ran into some problems, you can see in my topics, but when i tried this, it worked! THANKS! And now im making a custom module that simplifies this. I like making modules for others!

2 Likes

That’s awesome to hear, interested to see what the module’s like when you’re finished!

1 Like

For those wondering how to know if someone died, all you need is a local script, A remote event and a script, first make a remote event in ReplicatedStorage, I’ll call it DeathEvent and create a script in ServerScriptService name it whatever you want, put this code into it:

game.ReplicatedStorage.DeathEvent.OnServerEvent:Connect(function(plr)
	local char = plr.Character
	local hum = char:FindFirstChildOfClass("Humanoid")
	hum:ChangeState(Enum.HumanoidStateType.Dead)
end)

add this script to the character controller local script:

humanoid.HealthChanged:Connect(function(health)
	if health <= 0 then
        local hum:Humanoid = humanoid
	    game.ReplicatedStorage.DeathEvent:FireServer()
	    hum:ChangeState(Enum.HumanoidStateType.Dead)
    end
end)

The local script will trigger and tell the server about a death, the server will then change the state to Dead. Edit: I forgot to add health <= 0

2 Likes

I’d like to inquire about how to cancel the force I have on the unanchored part, which seems to be assumed to be friction, but I don’t know how to fix it. I want to cancel the force that is caused by my movement on the part under my foot

1 Like

This is (as far as i can tell) because of Newton’s third law (every action has an equal and opposite reaction). The only way I can see to fix this is to increase the mass of the unanchored object.

1 Like

Does newtons law REALLY works in roblox?? Thats realistic

Considering the controllers are physics based instead of scripted movement (which is how i assume the CoreScript for movement works) I don’t think it’s a far off hypothesis. May be wrong though, feel free to correct me

1 Like

Do you have any tips on how to implement other movement mechanics like double jumping, wall climbing, and wall running?

2 Likes

I have done wall running, if you don’t know how, I recommend you watch kaivexx’s video. You can watch tutorials for others as well; they work perfectly with controllers. (make sure to get controller scripts from the official post)

2 Likes

what is the advantages of using this? like what differences from humanoid? i never heard of this until now/

1 Like

Its more realistic/physics based than the default humanoids

2 Likes

Wow, 50 likes! Maybe I should extend this tutorial a bit…

1 Like
  1. Built-in controls for acceleration and deceleration
  2. Conservation of air momentum, useful for platformers or other movement-based games
  3. Intuitive checking for whether the character is midair or on the ground. Just check the controllerManager’s ActiveController property to see if it’s using the ground or air controller!
1 Like

ok this is the major reason ill use this, finally you can jump off a moving vehicle without getting left behind

1 Like

I really think you should add

raycastParams.RespectCanCollide = true

so raycast doesn’t detect noncollideable parts