- Home /
Too subjective and argumentative
Unity 3D Orienting on Tagged Surfaces / Wall Walking
Here's my movement script, just in case any reference needs to be drawn to that.
http://wiki.unity3d.com/index.php/RigidbodyFPSWalker
What I want to do is make it so that if a slope or a pillar or anything of that sort is tagged "climbable" or some such, that the player will automatically orient in rotation to make that the default "down" position. I have seen people use a more complicated matter of this principle to travel around planetoid objects, but I need to isolate it to only tagged surfaces and have the connection between surface be automatic.
As a visual example, my character touches against the base of the tree. Their orientation with thusly turn 90 degrees in order to make the direction of the tree "down" so that they can reach the top of the tree. They can travel around the cylindrical object but will also level off when they reach the top of the tree. If they jump off, their orientation will be returned to normal.
I don't know how complicated the principles are of that, and please tell me if you'd like a more concise elaboration. In a psuedo code manner:
If player collides with tag "climbable"
Then orient the player object against the slope of the object
Else player returns to standard orientation on the changed axis
Thanks!