Create an Escalator


I want to programm a escalator for a project. I have define a MotionPath and a MotionTracker for one Step. Now my Question, Can I use the same MotionPath and MotionTracker for each Step or I musst define for each Step a one MotionTracker.



@cpiesker said:
I want to programm a escalator

That line made my day. :)

Could you provide a code sniplet of your implementation for a single step?

I suggest to define a state machine for this first.

@Empire Phoenix

the right one


[snippet id=“48”]

The escalator object provides hole information e.g the sum of all Steps. The Box is a example and for testing. The State machine is a good idea, but I think that solve not my problem, or?

The “obvious” way I’d approach this as a first attempt is to:

Create one object containing all your central block of steps. Animate that through the slide then teleport it back to its starting position. That way you only have one object there no matter how long the escalator is.

At the same time use a few steps at the top to do the curving around the top/bottom. Again animate each to move by one step width then teleport back to it’s starting position in synch with the central core.

I don´t know what you mean respectively I don´t know how I implements your idea.

A small excursion, I want that the escalator transporte a player. I don´t know, if your way the best.

Can you show me a code snippet?


also I have solve my Problem at the first. I generate n MotionTracker with the same Path. I start the first MotionTracker and if the Step at a position where can start the next step i start the next Step.

But now I have a next Problem. I want to add Physics to the Motion, but doesn´t works. After a small search I found that I don´t can use the MotionTracker and Physics. I must use a cinematics, but I don´t know how, because the doku is interrupted on this part.

I searched in the forum, but I don´t find nothing what could be helped me.

Here is my momentary Class for the creating:

[snippet id=“52”]

I hope you can help me.

You also cannot combine cinematics and physics ^^ You have to decide: does the physics move the objects or do I?

Well I would use a animated model, the physic model would be flat, anda controller that pushes objects above it with some force sideways/upwards. (scale that force according to frriction and mass)

→ only one animated model

→ only one physic convex shape

→ no more sliding over stairs problems

1 Like


I want, that the Object move and the Object could be transport other Objects. The physics doesn´t move the Escalator Step.

@ Empire Phoenix

Sorry, my english is not good.I doesn´t understand, what do you mean with the physics convex shape? Can you get me links, tutorials or snippets.

Don’t think about how it works in real life. Think about how you can get the same effect with minimal code and minimum load on the system…

1 Like
@zarch said:
Don't think about how it works in real life. Think about how you can get the same effect with minimal code and minimum load on the system...

Exactly. Simulating a physics bone based robot that tries to balance itself on a stairway _is_ possible with jme but rather for research or fun, not for making a game. If you take things like euphoria for example you have to think very well if you want to sacrifice like 50% of your system resources to this effect.

Wow, that more work how I thought. If I understate that right, I must following the steps:

  1. I must create a Model with bones.

    By this way, it will be the best that I have one object. The Object represents a hole Escalator belt.
  2. After that I create animation with that.

    The animation is a small Problem for me, I have two turning points. so how I can animate that?

    A second idea is that I cut the hole Escalator in three parts. 2 Parts for the horizontal Way and one for the Way in the Air.

    The Problem is I have never two escalators that are the same. I have 15 Escalators with different length and horizontal steps.

… or jus animate the escalator in blender and then simply move the models along the elevator in a time that makes it look like they are actually carried :roll:

Go read one of my first posts.

Create a model which is one step.

Create a node.

Add X steps into the node to get the length of stairs you need. (Ideally optimize the geometry into one mesh once that’s done but for now just add them and get it working)

Animate those steps sliding through one step size and then teleport them back to the start by adjusting the position of the node they are all attached to. Nothing fancy needed, just a constant move speed and then jump back to 0 once offset reaches a certain point.

Then do the more complicated steps at the start/end of the escalator by animating them through their own sequence.

(None of this needs either animation tracks or physics - each step just follows a simple linear step then jumps back to the start).

Once the escalator is working and looking right you can then move onto the next step of getting the collision shape and the physics effect on objects on it. One thing at a time though.

But tbh if you are struggling even doing this then I think you’ve bitten off more than you can chew. Try something simpler to start with and save this idea to come back to once you have more experience.

1 Like