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
Fall Damage Bug
- transformes
- Contributor
- Posts: 27
- Joined: Mon Jul 24, 2017 2:31 am
such a problem exists ,to turn off the feature , Resources>MPlayer>bl_FirstPersonController>Fall Damage uncheck
- Lovatto
- Admin
- Posts: 1834
- Joined: Sun Dec 07, 2014 3:18 pm
- Contact:
- skr2000
- Contributor
- Posts: 169
- Joined: Thu Feb 02, 2017 8:23 pm
Recode the fall damage function. Here's the solution: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?
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);
}
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;
}