I am trying to make a unit bounce off a wall when it hits it at certain angles.
I know the way reflection works (like bouncing balls or something of the sort), but I can't get one fundamental value for calculation: the normal of the wall.
How can I get the normal angle of the wall?
I read that some people add a bunch of "units" representing the faces of the wall, but I really don't want to put so many units in my map just for this.
Is there a function, or trigger or whatever that is abble to determine the normal angle of the wall my unit just ran into?
It tests a series of 12 points 0.5 units away from the target point, and puts a positive weight on those that are downhill from the target location, and a negative weight from those that are uphill, and puts them all together. You might want to experiment with the number of test points and the distance, though.
I am trying to make a unit bounce off a wall when it hits it at certain angles.
I know the way reflection works (like bouncing balls or something of the sort), but I can't get one fundamental value for calculation: the normal of the wall.
How can I get the normal angle of the wall?
I read that some people add a bunch of "units" representing the faces of the wall, but I really don't want to put so many units in my map just for this.
Is there a function, or trigger or whatever that is abble to determine the normal angle of the wall my unit just ran into?
@AkumaNoRitomi: Go
What exactly is a "wall"
Is it a cliff? Is it the edge of a region? Whats a wall???
A wall is a cliff.
You're in luck because I wrote a function for exactly this.
It tests a series of 12 points 0.5 units away from the target point, and puts a positive weight on those that are downhill from the target location, and a negative weight from those that are uphill, and puts them all together. You might want to experiment with the number of test points and the distance, though.
Wait.... so it can make say, a marine... wall jump?
Thank you man! That surely solved my problem!
I messed around with it so it could work with everything, not just cliffs =D
Thanks for the enlightment!