Game Development Community

Best way to rail slide (i.e. skateboarding)

by Joshua Dallman · in Torque Game Engine · 12/16/2004 (8:29 pm) · 2 replies

Can anyone give a pointer in the best way to perform a rail slide similar to Sonic or Tony Hawk?

When you press the action button and a mount point near your feet is within a bounding box around a rail, you would attach to the rail and move forward on it until 1) you fall [using a Tony Hawk style balance meter], 2) you press some other action button [i.e. jump], or 3) the rail ends.

Do you think this could be done using script or should I be posting this in the private forum because it's definite serious modification involved? I'm not looking for a step-by-step, more just a general direction.

I hear there's a skateboard in TubettiWorld.

#1
12/16/2004 (11:12 pm)
The only thing I can think of doing in script would be to use PathMarkers to define a path down the length of the rail, and then switching the Player to path movement when he gets on the rail (like what the AIPlayer does). Then you would have to rebind the movement keys and mouse stuff to functions that do the balance checking instead of functions that affect movement. You would stop incrementing the $mv variables and instead just let the AI path movement do its thing, and just let the input affect your own state that you can use to do your balance checking on.

To implement the switching between AI movement and regular input-controlled movement, you may have to tweak the engine a little (add a boolean basically that tells you what mode you're in). Maybe not though.
#2
12/11/2007 (1:19 pm)
Joshua, did you ever accomplish this? I am in a similar situation myself :)