-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Description
Release Type: Official Release
Version: 4.2.0.2381
Platform(s): Windows 10
I created a new project from First Person Shooter template and started from adding Jump to PlayerController script:
(the event stuff is outside of the scope, Jump is called from Update)
private void Jump()
{
if (character.IsGrounded)
{
if (isJumping)
{
Log.Info("Landed");
isJumping = false;
}
jumpEventListener.TryReceive(out var jumpPressed);
if (!jumpPressed)
{
return;
}
var jumpDirection = new Vector3(moveDirection.X, 1, moveDirection.Z);
jumpDirection.Normalize();
character.Jump(jumpDirection * JumpHeight);
isJumping = true;
Log.Info("Jumping!");
}
else Log.Info("In air!");
}
To me it seems like the CharacterController's IsGrounded
property is hella bugged since I can just hold Space key and fly up, which obviously shouldn't happen.
To Reproduce
Steps to reproduce the behavior:
- Create new project from First Person Template
- Extend PlayerController with my method, hook it up to Jump key event from PlayerInput.
Expected behavior
Jump works.
Screenshots
Here's the screenshot of a single short key press result (multiple landings and jumps after it did not happened because of the input):
From what I'm seeing it jumps three times per key stroke, for that it also lands three times because it detects grounded state while being midair.