bhardy0630 / D-Pong

D-Pong collaborative game project
GNU General Public License v3.0
1 stars 1 forks source link

The paddleMovement script is bugged #3

Closed Jaaz- closed 5 years ago

Jaaz- commented 5 years ago

The movement only allows movement on the x-axis, where we need the paddles to move on the y-axis.

I think this may have to do with the characterController2D script, which was intended for sidescrolling platformers.

bhardy0630 commented 5 years ago

Bug confirmed in milestone build 1.

Assigning to myself.

bhardy0630 commented 5 years ago

The source of the issue is as follows:

Vector3 targetVelocity = new Vector2(move * 10f, m_Rigidbody2D.velocity.y);

The preceding snippet was taken from a sidescroller type tutorial. To resolve the issue, these arguments were flipped:

move * 10f

m_Rigidbody2D.velocity.y

And the last was changed to:

m_Rigidbody2D.velocity.x

resulting in a change of movement axis.

Resolved.