1. #1

    How do I make something rotate only on one axis?

    I'm making a level where you play the whole track inside of a wheel, and to move forward you have to make it roll. The problem is the wheel that the bike is inside starts to turn and tilt after a little while so it goes off the track and the bike just falls out.

    How can I make it so that the wheel stays straight with the driving line and only rolls forwards or backwards?
    Share this post

  2. #2
    LukeMSki's Avatar Senior Member
    Join Date
    Mar 2014
    Posts
    1,326

    Re: How do I make something rotate only on one axis?

    Try checking the "Lock to Driving Line" Box. This will only work if it has physics activated.
    Share this post

  3. #3

    Re: How do I make something rotate only on one axis?

    Originally Posted by LukeMSki
    Try checking the "Lock to Driving Line" Box. This will only work if it has physics activated.
    It's checked, the wheel stays on the driving line but it still tilts.

    I think I have it working now though. I ended up putting huge hit triggers on either side of the wheel so that when it tilts enough to hit them, the trigger sets off an object position event that sets the yaw/pitch to 0 and the bank to whatever angle Z of the wheel is at that time. When the event activates there is a slight pause in rotation but it's not very noticeable.

    Hopefully there is an easier, less hacky way of doing this that I just haven't found yet.
    Share this post

  4. #4
    Jarr3tt88's Avatar Senior Member
    Join Date
    Jan 2013
    Posts
    3,520

    Re: How do I make something rotate only on one axis?

    My suggestion would tie movement to an OPE, or have you tried a rotation hinge? Or sliders?

    Or perhaps an 'invisible track' the tire is inside.
    Share this post

  5. #5
    johnsalis's Avatar Senior Member
    Join Date
    Sep 2014
    Posts
    1,128

    Re: How do I make something rotate only on one axis?

    When you lock glued objects to the driving line, only the glue point gets locked to the driving line. I would suggest putting two dummy points on either side of the wheel, locking them to the driving line, then attaching them to the wheel using a hard point to point hinge for each one.
    Share this post

  6. #6
    dasraizer's Avatar Senior Member
    Join Date
    Apr 2014
    Location
    UK, Isle of Wight
    Posts
    1,195

    Re: How do I make something rotate only on one axis?

    would making invisible guide rails set to contact response and friction set to 0 do the job? bit of a cheat.
    Share this post

  7. #7
    Jarr3tt88's Avatar Senior Member
    Join Date
    Jan 2013
    Posts
    3,520

    Re: How do I make something rotate only on one axis?

    Originally Posted by dasraiser
    would making invisible guide rails set to contact response and friction set to 0 do the job? bit of a cheat.
    Thats kind of what I was suggesting. OPE might be the best option tho. Could control rotation, AND forward/backwards movement through horizontal stick movement and an equation.
    Share this post