hi guys
im not developing anything yet but ,i want to know ,how to implement a wall run,grabbing edges,jumping from one edge to other ,like gameplays of assassinscreed,pop,tomb raider etc
How to do these things?
hi guys
im not developing anything yet but ,i want to know ,how to implement a wall run,grabbing edges,jumping from one edge to other ,like gameplays of assassinscreed,pop,tomb raider etc
How to do these things?
gameprefabs.com has a set up similar to what you described
I would use a system of invisible trigger objects. If the player is in contact with the trigger and presses jump key ->then play wall run animation and go through the wall run code. There would probably have to be some code about forward momentum too, as if the forward speed is too little, you will fall instead of wall run. But that is one way to handle it and probably how most games do it. For ledge grabbing you would have invisible collision blocks attached to the player. So there might be a block for arms outstretched. If it collides with an object labeled as âgrabâ then start grab animation/code. Thatâs how I would handle things anyway. Anyone have ideas for a more efficient system?
bumping this, very curious
3dbuzz has a free unity character controller tutorial and they do this on a basic level.
easiest but longest dev time in terms of content creation are triggers.
You could conceivably automate the creation of the triggers by having the artist take advantage of vertex colors.
I have attempted a grabbing system and I just used multiple line-casts for several checks. This system worked for me on a basic level and I imagine it could be expanded so that it has the same functionality as assassins creed with a bit of work. The plus side to this system over triggers is that anything with a collider should work. This seems akin to what assassins creed did, I find it unlikely that they set up triggers for every ledge in the game.
I did a linecast version in an older engine I used. I simply cast slightly above head height at a 45 degree angle down like this:
s
\
p \
| \
^ \
e
The player is moving right, and the 45 degree beam is from above the player at an angle pointing down + right. It begins above the players head and ends at the players feet, and goes forwards by however far you want the player to reach. This is usually 45 degrees. s is start and e is end of ray.
Now the theory part. If your ray hits anything at all, check the angle of the hit. If it is an acceptably flat surface, ie pointing up and you collide with anything, you have all the information you need.
The hit will return the height of the surface.
Your collision will return the position of edge as well.
So with those two details you have the corner of a box and can easily just climb up to the height of the hit ray.
\
_\_____
| \
| the angled ray hits a potentially climbable surface.
|
Vertex color would give you some flexibility as well beyond automating placement of triggers. Paint blue, it allows you to traverse back and forth. Paint green, it allows you to climb up the ledge, etc.
Itâs best that the artist and game designer decide upon the areas anyhow, not something a programmer should be concerned about.
would you check for a collision with the vertex painted mesh? and then check the color of the vertex?
Not at all. The color of the vertex simply determines which script/state variables are set at runtime when the collider is instanced. isClimbable = true, etc.
Thanks for the clarification.
Quietus suggestion is provably the best one, the only thing left to do is a paint vertex tool for that pourpose.
My thought was that the vertex painting be done within the 3d modeling application, but a vertex painting tool within unity might have some benefits if the level is modular in nature. The level designer could conceivably want the same mesh in multiple places each having different characteristics.
Point being, that it needs to be set up at author-time whether itâs a labor intensive hand placement of box colliders or procedurally generated through vertex color. An algorithmic approach using raycasts or whatnot to detect ledges would place severe limits on how your meshes are constructed, hard edges etc, otherwise your avatar would be climbing like a monkey into places where heâs not supposed to.
What if I already use vertex colors for texture blending?
Then I imagine you could encode the data into the mesh tangents, for if youâre blending textures itâs not likely youâre using a bump mapped shader.
i know this probably sounds a bit beginner-ish butâŠumm is a trigger a script that is added to a box collider and the script tells the player to activate the animation? so yeah im trying to do an Assasins creed type freerunning system as well. xD
Trigger is just a normal Collider that has the option âIs triggerâ enabled, makes them fire trigger messages instead of collider messages.
You can then access them via the OnTriggerEnter, OntriggerExit and OnTriggerStay functions.
Just like their name suggest they tell the gameobject calling the functions whatever they just entered, exited or is inside a trigger zone.
There are plenty of tutorials about triggers, google around a bit youâll find them.
Procedurally. no triggers or such. You have to find out how your char and the environment should interact, i.e with raycasts, colliders, etc. and then move the char along that environment appropriately. I used traces in UDK for my parkour, you can use raycast and the logic should be, "if whatever it touches is not null, it should move up or down along that object. "
You should learn about normals; they still give me trouble to fully understand it. Look at my videos on youtube page.