TarynMcMillan / CollaboRun

Our collaborative Infinite Runner game, made in Unity 2D.
1 stars 1 forks source link

add ground check for player movement script #2

Closed Niko-9 closed 2 years ago

Niko-9 commented 2 years ago

1

The "Ground" Layer should be assgined to to ground.

TarynMcMillan commented 2 years ago

Thanks for your contribution to the project! I've tested your code and it doesn't seem to work properly unless the ground radius value is ~1.5. Is this intentional? I see it is initialized at a lower value in the PlayerMovement class so I just wanted to double check before merging your request.

Niko-9 commented 2 years ago

Thanks for pointing that out ! Yes, since collider size is set to 3 on y axis, the radius must be at least half that value to detect collides with any ground object, I will change the origin point to bottom instead of center.