Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The Slime Critter attack throws the player several meters away #349

Closed
Eddrico opened this issue Feb 3, 2021 · 10 comments · May be fixed by #404
Closed

The Slime Critter attack throws the player several meters away #349

Eddrico opened this issue Feb 3, 2021 · 10 comments · May be fixed by #404
Labels
? Action required: missing information, question to answer, or CLA not signed bug (important) This needs to be fixed before shipping, but not as a first priority

Comments

@Eddrico
Copy link

Eddrico commented Feb 3, 2021

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:

1.- Open a scene with the TestingGround. Press play.
2.- Get near a Slime Critter and wait for his attack.
3.- When the attack is about to connect, press the jump button.
4.- Observe that the player is sent flying away.

Notes

Here's a video of the issue:

https://www.youtube.com/watch?v=pnKQh3bKC8Y

@ciro-unity
Copy link
Contributor

@ciro-unity ciro-unity added the bug (important) This needs to be fixed before shipping, but not as a first priority label Feb 3, 2021
@treivize
Copy link
Contributor

treivize commented Feb 4, 2021

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.

@ciro-unity
Copy link
Contributor

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:

https://youtu.be/aQ9KuTuTNbM

I'm not jumping at all here!

@treivize
Copy link
Contributor

treivize commented Feb 8, 2021

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.

@ciro-unity
Copy link
Contributor

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.

@AlexandreGheraibia
Copy link
Contributor

AlexandreGheraibia commented Feb 13, 2021

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;
}

@AlexandreGheraibia
Copy link
Contributor

AlexandreGheraibia commented Feb 13, 2021

Velocity ​​is zero when you update idle state

@r4hulCorleone
Copy link

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.

@amel-unity
Copy link
Contributor

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!

@amel-unity amel-unity added the ? Action required: missing information, question to answer, or CLA not signed label Apr 19, 2021
@amel-unity
Copy link
Contributor

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 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
? Action required: missing information, question to answer, or CLA not signed bug (important) This needs to be fixed before shipping, but not as a first priority
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants