Thank you Yal you are a gem, it worked perfectly! Yeah, I've already taken care of collision with the rotated ramp (used rectangle with rotation as you mentioned), I was just missing this final piece of the puzzle.One thing is my frame rate takes quite a hit now when walking on ramps, is dot_product just a very expensive function?
^Disregard - my collision code was causing a bottleneck.
Thanks again!
No problem, glad it worked out so quickly!
Dot product is a very simple operation, it's just the sum of every vector component multiplied with the same component of the other vector (so the 2D case is 2 multiplications and 1 addition), so it should be faster than e.g. doing a geometric solution with trigonometry most of the time. The only thing it really does is tell you how parallel two vectors are, but it's the best choice if you need that exact thing!