1. #1

    How to make a custom character lean

    Hello everyone, sorry if this has been covered but I didn't find anything.

    I'm looking to have a custom playable character lean - for instance, the Monster Truck.
    I've already got the gas/brake/reverse set up and it's moving along nicely, but I'd like to be able to lean the truck much like the rider leans the bike, in a beautifully unrealistic way.

    I've currently set this as two direction forces glued to the underside of the player character at 45 degree angles, attached to analog movements left and right, respectively.

    This DOES allow leaning of the vehicle, and it works great on ground, but looks very odd when in mid-air;
    Leaning back, for example, causes the player to sort of 'glide'.
    While leaning forward make the player slam down, for some reason.

    I'm looking for a method of leaning as closely to the traditional bike as possible, without the gliding or slamming
    Thanks in advance for any help!
    Share this post

  2. #2

    Re: How to make a custom character lean

    I'm not at my Xbox but off the top if my head u could try , add the sliding hinges to the truck like a suspension? loosen them and when it turns it may lean...other the that I'm
    Out lol good luck , let me know if it works
    Share this post

  3. #3

    Re: How to make a custom character lean

    Thinking about it if that works u have a monster truck with adjustable suspension lol that is sick
    Share this post

  4. #4

    Re: How to make a custom character lean

    Do you have the sources tied to the stick directly, i.e. do both forces activate when you tilt the stick? In this case, they *should* -- when you tilt the back up, you want the forward to tilt down by an equal amount, thereby resulting in an equivalent (but opposite) amount of upward and downward force.

    If that doesn't work, you could try having two dummy objects glued to the truck with physics enabled - one in front, one in back. When the player holds the stick forward, increase the weight of the forward dummy object and decrease the weight of the rear dummy object; when the player pulls the stick back, do the reverse. This should result in a very realistic lean, given that it's using the same physics as a biker's lean does! Note that you will want to have a min/max cap on both of these (using a filter to halt weight changes when it would bring either object above its maximum value or below its minimum value). You will probably also want to reduce the truck's weight by the sum of the dummy objects' weights (you should do this in the editor, there's no need to have a trigger/event adjust it on the fly).
    Share this post

  5. #5

    Re: How to make a custom character lean

    Thank you for the replies, and sorry for not responding sooner.

    The slider idea worked an absolute treat, thank you for that idea!

    It's actually a Monster BIKE... What I've done is add sliding hinges to the front and back that attach the wheels to the bike itself, then a Linear motor applying +/- force up and down from the analog stick, this 'pulls' the front wheel up, or pushes it back down as needed. This also works with the back wheel.
    This method works better than the directional force, because now it can do jumps without the force visually pushing it up/across when you try to lean.

    It's uploaded now, actually. But I shamefully messed up the leaderboards TWICE

    Search gamertag 'Xiaou' and download "Monster-Bike (Fix)" to check it out.
    Feedback much needed, as I plan to make more like this when I get better at the editor.

    PS. "Monster" was inappropriate language.
    Share this post