Not counting score when jump landing is on same platform

88057-instantiate-platform.jpg

I have an endless jumper where a new platform gets instantiated after reaching the next platform by entering it’s box collider as trigger. Also when you enter the platform’s box collider the score gets inscreased by one.

But here is the problem, if the force on the jump is to low you still land on the same platform so the score gets increased although you are still on the same platform. How can I prevent this from happening without changing the settings on the jumpforce? I was thinking on checking if I’m still on the same platform, but since I’m new to Unity I don’t know really where to start.

Can someone help me in the right direction?

You can store character position pre and post jump. If distance travelled is >x then add score?

Got it working, it became another approach, but its working.

// Increment score and instantiate platform. Also check if last platform was allready landed on
				if (ScoreManager.instance != null && GameManager.instance != null) {

						if (target != lastPlatformJumpedOn) {


							lastPlatformJumpedOn = target;
							ScoreManager.instance.IncrementScore ();
							ScoreManager.instance.HighScore ();
							GameManager.instance.CreateNewPlatformAndLerp (target.transform.position.x);
						}
					} else {
						ScoreManager.instance.IncrementScore ();
						GameManager.instance.CreateNewPlatformAndLerp (target.transform.position.x);
						lastPlatformJumpedOn = target;
					}

				
				

			}
		}