|
I want a game where buildings and things are climbable like the game [prototype], the way it would work is that if youre pressing the Z key you enter free-run mode. Im fairly new to scripting and only know JavaScript, tutorials would be apreciated so I can get it fixed into my head and maybe prevent me from asking more questions than I need to.
(comments are locked)
|
|
I'm always late in answering questions on Unityanswers, but... The first function takes in the "vect" from "GetMoveDir," all you have to do is insert the "normal" from a raycast. Should work 100% of the time if I copied the right bit. Also, I always use Translate(vector, Space.World) or more recently Rigidbody.MovePosition, Translating an object with respect to itself gets annoying during jumps, as you have to recalculate every--single--frame. This will work on walls and ceilings. It'll work as you expect on walls and floors, but if I'm not mistaken, ceiling controls will be inverted. I wrote all this myself, so I should know the fine details a little better, but w/e.
(comments are locked)
|
|
Another "easy" way to do this, using Unity's charactercontroller is by using "Slope Limit". It's a build-in function which allows you to change how high a slope your character can walk, run or climb. - I know this isn't exacly like PoP but it's a start, right? :) Hope this will help :)
(comments are locked)
|
|
To run up walls isn't bad, but gets trickier depending upon how you implement your running in the first place. The simple solution is to raycast in the direction you are running and align your animations to the surface if it is within a certain distance (the distance you'll be moving in the current frame for example). If you add inertia or anything like that, you'd want to consider that too. I recommend looking at the locomotion system for more on aligning animations to a surface. Raycasting is simple.
Also, since you know that the normal you're aligned to is not the world up, you can do smart things like balancing the weight against the surface (wall running la Prince of Persia). You should also take into account collisions and the character's lean if they lean into their running animation.
(comments are locked)
|

I want to do that too... you have to write your own character controller. in a simple way I guess you want when you collide to a wall the forward input key to be translated to the upward input key. Mirror's edge had a much more complicated structure where each of the grip points were behaving differently. Great stuff.
what's with the free tag?