From 27b65ad2f76f5fb8f3616ca65e12ccbaea84400b Mon Sep 17 00:00:00 2001 From: kimura Date: Mon, 25 Jul 2022 16:04:48 +0900 Subject: [PATCH] =?UTF-8?q?=E5=80=8D=E9=80=9F=E6=99=82=E3=81=AE=E3=82=81?= =?UTF-8?q?=E3=82=8A=E8=BE=BC=E3=81=BF=E5=AF=BE=E5=BF=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- popcorn/Assets/MyGame/Scenes/MiniGame/Scripts/Player.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/popcorn/Assets/MyGame/Scenes/MiniGame/Scripts/Player.cs b/popcorn/Assets/MyGame/Scenes/MiniGame/Scripts/Player.cs index 5ab9b27b..3e9a0bac 100644 --- a/popcorn/Assets/MyGame/Scenes/MiniGame/Scripts/Player.cs +++ b/popcorn/Assets/MyGame/Scenes/MiniGame/Scripts/Player.cs @@ -168,7 +168,8 @@ namespace MyGame.Scenes.MiniGame.Scripts currentFallSpeed -= fallAcceleration * Time.deltaTime * currentSpeedMultiply; } - transform.AddLocalPositionY(currentFallSpeed * Time.deltaTime * currentSpeedMultiply); + var newYPos = transform.localPosition.y + currentFallSpeed * Time.deltaTime * currentSpeedMultiply; + transform.SetLocalPositionY(Mathf.Max(basePos.y, newYPos)); }, () => { currentFallSpeed = 0f;