0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

3D 移動床

Last updated at Posted at 2025-05-03

Unity 2022.3.18f1

・3Dの移動床はこちらの方の参考


    void AddVelocity()
    {
        if (isRide == false) return;

        if (rb3.velocity.sqrMagnitude <= 0.01f)
        {
            return;
        }

        for (int i = 0; i < rigidBodies.Count; i++)
        {
            var yReset = rb3.velocity;

            //キャラが跳ねるのを防止
            yReset.y = rb3.velocity.y*0;

            if (rb3.velocity.y>0)
            {
                yReset.y = rb3.velocity.y * -(1*SPEED);
            }

            rigidBodies[i].AddForce(yReset, ForceMode.VelocityChange);
        }
    }

説明
Y座標を床が移動するときに跳ねてしまっていたので
上方向に移動するときのみ反対方向に力を加えている?

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?