Skip to main content
5 votes

How are character controllers built upon complex gameplay systems?

It sounds to me like you are trying to accomplish the impossible. There are limitations to how flexible and reusable you can make a system. Remember that a system with infinite flexibility will also ...
Kevin's user avatar
  • 6,976
3 votes
Accepted

What is ApplyBuiltinRootMotion and how to use it?

When you have a script on your gameObject that implements OnAnimatorMove(), then the root motions of any animations are ignored. That is unfortunately not ...
Philipp's user avatar
  • 123k
3 votes

Should a CharacterBody3D be the root of a character, or a child node?

It is purely personal preference. When I develop in Godot I take the approach "make it work then make it better". So I would probably start structuring my scenes in the simplest way possible,...
Applekini's user avatar
  • 8,543
3 votes
Accepted

What's "isMatchingTarget" in Unity?

As the documentations says, this property tells you If automatic matching is active. OK, not very helpful, because it does not tell us what "automatic matching" actually is. But if we look ...
Philipp's user avatar
  • 123k
3 votes
Accepted

How to get/edit the script of the built-in "Character Controller" component?

The shipped CharacterController is located in the UnityEngine.PhysicsModule.dll. Now depending on the IDE you are using, you could still take a look at the source. ...
Zibelas's user avatar
  • 5,012
2 votes

Character controller falling with positive speed

The problem was that the animator controller had checked the "Apply root motion" option. After unchecking it everything went back to normal. It seems my idle animation was not correctly ...
correojon's user avatar
2 votes
Accepted

Decelerating player's momentum without changing direction

The Source of the Problem Using move_toward separately on each axis will reduce both x and z toward 0 at the same rate until one of them reaches the destination, ...
LudoProf's user avatar
  • 846
1 vote
Accepted

How do I implement the "collide and slide" algorithm in Unity?

If your character can be well-represented by a capsule (or sphere), then you can get this behaviour out of the box using the CharacterController component. This is designed for implementing player ...
DMGregory's user avatar
  • 141k
1 vote
Accepted

In Unity, how can a regular RigidBody know if it collided with a CharacterController?

You could add a script like this to your object with a Character Controller: ...
DMGregory's user avatar
  • 141k
1 vote

Character controller that can handle sloped terrain and boxy ledge traversal

I recently came across this video about stair traversal in videogames, and I liked the way the solution looked. I think the main way it differs from your most recent attempt is that it only snaps ...
mcmuffin6o's user avatar
1 vote

How to allow a CharacterController to pass through walls?

Unity has a "Layer Collision Matrix" that lets you define interactions between different layers. I'm guessing that you will want to: Assign the player to a Player layer. Assign the ...
John B's user avatar
  • 174
1 vote

How to compare a vector to a rotation in Godot 4.1?

I'm not sure I understand the issue... So, I'll give you three scenarios, hopefully I cover your case. First scenario: You want to know which way is ...
Theraot's user avatar
  • 28.2k
1 vote

irregular physics using character controller

So, I did some more testing, it seems like when I locked the frame rate it seemed to solve the issue. Initially, the game ran at 300-400 fps with an unlocked frame rate, whereas using ...
Jambo's user avatar
  • 11
1 vote
Accepted

Detect collision occurring on a parent CharacterController from a child object

Use a Unity Event to relay the message anywhere you want. ...
DMGregory's user avatar
  • 141k
1 vote
Accepted

Determine when a character is stationary, and which direction they are facing

Thanks for the input from everyone here. I managed to find a good solution to this that updates almost instantly. Before any of the functions: ...
EvelynSays's user avatar
1 vote

How to stop the slide on slopes?

Dynamic Rigidbodies act like real-life physics. Imagine you had a box on a slope: It would slide down. The same thing happens when you have a dynamic Rigidbody on your player. These are some solutions:...
CheckerT's user avatar
  • 176
1 vote

Stop 2D platformer character from sliding down slope

Unity here is constantly running physics simulation (trying to mimic the actual world a bit) and thus applies various forces to your rigidbody2d depending on situation. If rigidbody is on the slope ...
ShoulO's user avatar
  • 519
1 vote
Accepted

Rotating fps rigid body on the Y axis

Your code assumes that MoveRotation(rot) takes an increment to add to the current rotation. That's not what it does. It takes an absolute orientation to move to, ...
DMGregory's user avatar
  • 141k
1 vote
Accepted

Momentum-wise accurate player controls in Unity regarding collisions

The way I like to solve this is to use a dynamic Rigidbody, and give my character control script a notion of "traction" - the maximum force they can exert ...
DMGregory's user avatar
  • 141k
1 vote
Accepted

How can I have the character come back to its full height after crouching?

The reason for your problem could be that you have just one variable ControllerHeight which gets both changed and used to restore the value of ...
Philipp's user avatar
  • 123k
1 vote

Capsule getting stuck on edge of block

This question has been answered, thanks to DMGregory for editing this, because if i didnt have those specific keywords i wouldnt have been able to find answer Fix In the character controller compoment ...
PWalkersCrisps's user avatar
1 vote

Unity3d Rigidbody movement along slope slowdown

Hatoru Hansou adviced that I set velocity instead of addforce, but for various reasons involving my other locomotion requirements (wallwalking and grappeling/swinging) this is something I want to ...
Relativ9's user avatar
1 vote
Accepted

Implementing a Turn Radius for a Character

The Methods Vector3.RotateTowards or Quaternion.RotateTowards can help you here. They turn the object towards the desired ...
Philipp's user avatar
  • 123k
1 vote

How can I reset the mouse axes when respawning a player?

You don't need to reset the mouse axes. The mouse axes (e.g. Input.GetAxis("Mouse X")) reflect mouse movement over the last frame. If you do not move the ...
Kevin's user avatar
  • 6,976
1 vote
Accepted

State Machine implementation issues

Here's a theory on what's happening, all in a single frame: The player presses "E" - Input.GetKeyDown(KeyCode.E) will return true for this frame. Your state machine ...
DMGregory's user avatar
  • 141k

Only top scored, non community-wiki answers of a minimum length are eligible