Fall Damage Bug

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

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

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

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

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?
How to find your Invoice Number: Here
How to find your Order Number: Here
User avatar
jony12
Contributor
Contributor
Posts: 223
Joined: Mon Sep 24, 2018 12:46 pm

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

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

yeah, need fix
User avatar
skr2000
Contributor
Contributor
Posts: 169
Joined: Thu Feb 02, 2017 8:23 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