You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Short description
When jumping in certain rock formations, sometimes the player doesn't finish sliding. When that happens the directional movement becomes unresponsive (jumping sometimes does work to help the player reach the ground, but apparently not always).
It seems to be the same problem described on issue #350
The difference though is that I noticed it happening when the player is not surrounded by rocks (see video below)
Expected behavior
The player finishes sliding and returns to Idle state
To Reproduce
Steps to reproduce the behavior:
Play the "TestingGround" scene
Go to the rock formation at position (-51.1, 0, -14.81)
Jump at it as shown in the video below
Sometimes the player will get stuck and not finish sliding
Notes
The video below shows the problem happening. Note that the State Machine doesn't leave the sliding state
SlideBug.mp4
Even though I used a specific rock as an example, the problem happened to me in other locations. Including in the Beach location after I built the game
This problem doesn't always happen. It seems to be happening quite randomly to me
I did a little debugging and the problem seems to be related to high frame rates (SEE EDIT BELOW). In the screenshot of the console below (taken during the video above) we can see that:
The first line (SLIDE ACTION VELOCITY: ....) shows the velocity vector calculated in SlideActionSO.cs. It has a negative value in the y component, which seems to be correct. This velocity is the one that is set in the movementValue vector of the Protagonist script and is then used in the ApplyMovementValueSO.cs to apply the movement.
The second line (Movement Vector: ...) shows the value of the movementValue vector the ApplyMovementValueSO.cs script uses. It has the same value calculated in the SldeActionSO.cs, which is also correct
The third line (deltaTime: ....) shows the Time.deltaTime value used as a multiplier in the ApplyMovementValueSO.cs script
The fourth line (Moving towards: ....) shows the resulting product between movementValue and Time.deltaTime. The result has the y component equal to zero, which is not correct (in this case, the expected value should be around -0,0016). I imagine this is happening because the Time.deltaTime is a very small number and the result is rounded to 0
EDIT
After a little research, I found the problem was (probably) not related to frame rates. It seems that printing a Vector3 will automatically round its value but it doesn't mean the "real" value was rounded.
I did more testing and even when the y component of the movementValue vector is not zero the problem still happens (see video below. This time I recorded the console too).
bugSlide2.mp4
I also added code to debug the CollisionFlags returned by the CharacterController.Move method (the same code described in this link). In the image below the "Move towards" vector is not zero, but when that screenshot was taken the player was stuck in the air (second video). Also, it seems the controller is only detecting a collision below the player. Can that collision be preventing the player from falling in this case?
The text was updated successfully, but these errors were encountered:
tfloreste
changed the title
Player doesn't leave sliding state (probably related with high framerates)
Player doesn't leave sliding state (probably related to high framerates)
May 2, 2021
tfloreste
changed the title
Player doesn't leave sliding state (probably related to high framerates)
Player doesn't leave sliding state
May 2, 2021
Thanks @tfloreste. Like all of these "bugs", let's keep it open for a while but at the same time it's not something that worries us too much as long as gameplay is functional, since this is not a platformer game so we're inclined to accept a little degree of these edge cases.
Short description
When jumping in certain rock formations, sometimes the player doesn't finish sliding. When that happens the directional movement becomes unresponsive (jumping sometimes does work to help the player reach the ground, but apparently not always).
It seems to be the same problem described on issue #350
The difference though is that I noticed it happening when the player is not surrounded by rocks (see video below)
Expected behavior
The player finishes sliding and returns to Idle state
To Reproduce
Steps to reproduce the behavior:
Notes
SlideBug.mp4
Even though I used a specific rock as an example, the problem happened to me in other locations. Including in the Beach location after I built the game
This problem doesn't always happen. It seems to be happening quite randomly to me
I did a little debugging
and the problem seems to be related to high frame rates(SEE EDIT BELOW). In the screenshot of the console below (taken during the video above) we can see that:The first line (SLIDE ACTION VELOCITY: ....) shows the velocity vector calculated in SlideActionSO.cs. It has a negative value in the y component, which seems to be correct. This velocity is the one that is set in the movementValue vector of the Protagonist script and is then used in the ApplyMovementValueSO.cs to apply the movement.
The second line (Movement Vector: ...) shows the value of the movementValue vector the ApplyMovementValueSO.cs script uses. It has the same value calculated in the SldeActionSO.cs, which is also correct
The third line (deltaTime: ....) shows the Time.deltaTime value used as a multiplier in the ApplyMovementValueSO.cs script
The fourth line (Moving towards: ....) shows the resulting product between movementValue and Time.deltaTime. The result has the y component equal to zero, which is not correct (in this case, the expected value should be around -0,0016). I imagine this is happening because the Time.deltaTime is a very small number and the result is rounded to 0
EDIT
After a little research, I found the problem was (probably) not related to frame rates. It seems that printing a Vector3 will automatically round its value but it doesn't mean the "real" value was rounded.
I did more testing and even when the y component of the movementValue vector is not zero the problem still happens (see video below. This time I recorded the console too).
bugSlide2.mp4
I also added code to debug the CollisionFlags returned by the CharacterController.Move method (the same code described in this link). In the image below the "Move towards" vector is not zero, but when that screenshot was taken the player was stuck in the air (second video). Also, it seems the controller is only detecting a collision below the player. Can that collision be preventing the player from falling in this case?
The text was updated successfully, but these errors were encountered: