Fall Damage Bug

General support.
Post Reply
User avatar
simeon
Member
Member
Posts: 51
Joined: Mon Jun 10, 2019 10:26 am
Contact:

Wed Jun 12, 2019 1:33 pm

Hello,

i have add ne map to my game but if i walk i die on some random places.

how can i delete the fall dmg or fix my problems
User avatar
transformes
Contributor
Contributor
Posts: 27
Joined: Mon Jul 24, 2017 2:31 am

Thu Jun 13, 2019 2:40 am

such a problem exists ,to turn off the feature , Resources>MPlayer>bl_FirstPersonController>Fall Damage uncheck
User avatar
jony12
Contributor
Contributor
Posts: 223
Joined: Mon Sep 24, 2018 12:46 pm

Thu Jun 13, 2019 2:46 am

This bug has been a long time, and is not fixed.
User avatar
Lovatto
Admin
Admin
Posts: 1448
Joined: Sun Dec 07, 2014 3:18 pm
Contact:

Thu Jun 13, 2019 9:37 pm

Hi,

You guys have any way to reproduce this?
I mean, I know that it happen randomly, but have you found a way to reproduce it so I can fix it?
User avatar
jony12
Contributor
Contributor
Posts: 223
Joined: Mon Sep 24, 2018 12:46 pm

Fri Jun 14, 2019 2:58 am

When you run and go through something.. curb, or other.
Just running through something.
User avatar
jony12
Contributor
Contributor
Posts: 223
Joined: Mon Sep 24, 2018 12:46 pm

Sat Jun 15, 2019 3:17 am

Lovatto fixed this Bug.
User avatar
AndreyWindigo
Contributor
Contributor
Posts: 20
Joined: Wed May 15, 2019 6:14 am

Sat Jun 15, 2019 2:05 pm

yeah, need fix
User avatar
skr2000
Contributor
Contributor
Posts: 161
Joined: Thu Feb 02, 2017 8:23 pm

Sun Jun 16, 2019 5:37 pm

Lovatto wrote:Hi,

You guys have any way to reproduce this?
I mean, I know that it happen randomly, but have you found a way to reproduce it so I can fix it?
Recode the fall damage function. Here's the solution:

Code: Select all

	[Header("Fall Damage")]
	public bool FallDamage = true;
	public float fallDamageThreshold = 10;
	public float fallDamageMultiplier = 5f;
	public bool falling;
	private float fallDistance;
	private float fallHighestPoint;

Add this code under if (!m_PreviouslyGrounded && m_CharacterController.isGrounded)

Code: Select all

			falling = false;
			fallDistance = fallHighestPoint - transform.position.y;
			if (FallDamage && fallDistance > fallDamageThreshold) {
				DamageManager.GetFallDamage (fallDistance * fallDamageMultiplier);
			}
Add this code under fixedupdate, when character controller grounded bool is false

Code: Select all

			if (!falling) {
				fallHighestPoint = transform.position.y;
				falling = true;
			}
			//Check if we moved higher for some reason
			if (transform.position.y > fallHighestPoint) {
				fallHighestPoint = transform.position.y;
			}
Also, dont forget to change getfalldamage to work fine
Post Reply