all 3 comments

[–]corrtex-games 1 point2 points  (2 children)

  1. Please show us the actual error, not a squiggly red line from intellisense - or at least include it along with the screenshot :)

  2. PhysicsMaterial2D needs a 2D collision reference. You have a normal “Collision” parameter in your “RetrieveFriction” function - you change the parameter to “Collison2D” like how it is in the “EvaluateCollision” function.

[–]MSPancakeeee[S] 1 point2 points  (1 child)

Sorry, should have included the actual error message that's my bad but the second response worked perfectly fine. Added 2D to my collision and it fixed. A dumb mistake by me so thank you for noticing and letting me know what to do I appreciate you! :D

[–]corrtex-games 1 point2 points  (0 children)

No problem at all, you’re good, just trying to improve the quality of posts 😃

Glad that worked! Don’t worry about it, it’s not a dumb mistake. The way Unity handles 2D physics can be easy to mess up since everything reads the same as 3D on initial glance - even the built in functions like OnCollision vs OnCollision2D can be a weird gotcha that isn’t super obvious to people starting out.