Closed Eddrico closed 3 years ago
For this one, I would suggest to wait for the coming PR about combat system to be merged before starting to solve it. Jumping will be prevent when the player is getting hit by the slime critter attack, so this bug should not be reproduceable after the integration of this part of the system.
The issue doesn't happen because the player jumps. It just happens when it's squashed by the attack against a rock or wall.
I actually made a video of it some time ago:
I'm not jumping at all here!
Indeed, but are you able to reproduce it now that the player is really getting hit by the critter? I have just tried multiple times to reproduce it without success.
No I don't think so. The initial description can throw you off guard: it's not that the inertia is transferred (I think) since the player has no Rigidbody. Most probably what was happening is that the Critter would move into the player -> Next frame the player is pushed out (as would two colliders one inside the other). But now that the Hit is implemented, the player instantly plays an animation which keeps it anchored to the spot it is (root motion?) so it doesn't fly away. Why doesn't he fly away after the animation is done, I'm not sure. (these are all guesses)
In any case, no, I don't generally see it now. I will check again for some time, then close.
Maybe because in StopMovementActionSO called by Idle you have:
public override void OnUpdate()
{
if (OriginSO.Moment == SpecificMoment.OnUpdate)
_protagonist.movementVector = Vector3.zero;
}
public override void OnStateEnter()
{
if (OriginSO.Moment == SpecificMoment.OnStateEnter)
_protagonist.movementVector = Vector3.zero;
}
public override void OnStateExit()
{
if (OriginSO.Moment == SpecificMoment.OnStateExit)
_protagonist.movementVector = Vector3.zero;
}
And in ApplyMovementVectorActionSO also called by Idle you have :
public override void OnUpdate()
{
_characterController.Move(_protagonistScript.movementVector * Time.deltaTime);
_protagonistScript.movementVector = _characterController.velocity;
}
Velocity is zero when you update idle state
Hi, as i informed in unity forum, I like to work on this bug, producing the bug was hard for me because i need better timing, so i wrote a simple code that player does a jump action with delay after critter starts to attack, and with a proper delay, i reproduced the bug when player jumps successfully for a lot of times. I will search for the root of this bug, i think @AlexandreGheraibia comment is a good start point for me. i will notify you when i find out more about the bug.
Hey everyone! Is anyone still able to reproduce the issue on the current main branch? If yes, can you please make a video? I tried to reproduce it but it seems like it is fixed. Thanks!
Looks like the issue has been fixed so I will close it just to avoid that anyone spends time looking into fixing it. Thank you all :)
Short description When the slime critter attacks and the player jumps, the inertia of the attack is transferred to the player, throwing the player several meters away.
Expected behavior The attack should not push the player so far.
To Reproduce Steps to reproduce the behavior:
Notes
https://www.youtube.com/watch?v=pnKQh3bKC8Y