Page 1 of 1
Fall Damage Bug
Posted: Wed Jun 12, 2019 1:33 pm
by simeon
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
Re: Fall Damage Bug
Posted: Thu Jun 13, 2019 2:40 am
by transformes
such a problem exists ,to turn off the feature , Resources>MPlayer>bl_FirstPersonController>Fall Damage uncheck
Re: Fall Damage Bug
Posted: Thu Jun 13, 2019 2:46 am
by jony12
This bug has been a long time, and is not fixed.
Re: Fall Damage Bug
Posted: Thu Jun 13, 2019 9:37 pm
by Lovatto
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?
Re: Fall Damage Bug
Posted: Fri Jun 14, 2019 2:58 am
by jony12
When you run and go through something.. curb, or other.
Just running through something.
Re: Fall Damage Bug
Posted: Sat Jun 15, 2019 3:17 am
by jony12
Lovatto fixed this Bug.
Re: Fall Damage Bug
Posted: Sat Jun 15, 2019 2:05 pm
by AndreyWindigo
yeah, need fix
Re: Fall Damage Bug
Posted: Sun Jun 16, 2019 5:37 pm
by skr2000
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