Skip to content

Commit d2de4fe

Browse files
committed
fix: check if nan or infinity
1 parent 989c2e2 commit d2de4fe

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Assets/JCSUnity/Scripts/Actions/3D/JCS_3DThrowAction.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,11 @@ private void Update()
112112
// make it effect by gravity.
113113
this.mVelocity.y += JCS_Physics.GRAVITY * mGravityProduct * dt;
114114

115-
// add up velocity.
116-
this.transform.position += mVelocity * dt;
115+
if (!JCS_Mathf.IsNaNOrInfinity(mVelocity))
116+
{
117+
// add up velocity.
118+
this.transform.position += mVelocity * dt;
119+
}
117120

118121
if (mFaceFoward)
119122
{

0 commit comments

Comments
 (0)