So I’m trying to implement a thing often seen in games: objects (like grass, essentialy a plane, in my case a simple box) being pushed (rotated) away from the player as the player approaches. I’m sure the trick is rotation, but my math skills seem to fall flat. I’ve tried reusing the
y rotation of the player, but I still need to find a way to transform a direction along the
xz plane so that the object is rotated (“laid down”) flat away from said position. It would also be great if that rotation could be handled on an already arbitrarily rotated mesh.
Any one attempted this before or know of any resources?