So I’m building a vine climbing puzzle element, and it’s pretty much working except I’ve had to use a workaround for setting the players XY position whilst on the vine.
Essentially my preferred solution would be to get a line form the vines start and end, then return the XY values of a point along the vine at a given Z height. Any ideas on how to achieve this?
Ok so I figured it out, it’s actually quite simple.
Divide ( top of vine Z position - players Z position) by ( top of vine Z position - bottom of vine Z position) to give you a value equivalent to how far the player is up the vine as a decimal value ( between 0 and 1)
Use this value to lerp between to XY values for the top and the bottom of the vine, then use the results to set the players XY.