kurhlaa Posted March 30, 2018 Share Posted March 30, 2018 Hi, I'm trying to implement a walking up/down vertical stairs, for example from the ground to the roof. Unfortunately I have no completely working ideas. Somehow player's mesh should: 1. With WS keys move Up/Down when he is next to the stairs; 2. When he is at the top of the stairs - he should go forward instead of Up, to the roof, without falling down after disconnecting from the stairs; 3. When his mesh is walking down and reaching the ground - he should "disconnect" from the stairs and start walking normally with the same S key pressed. Could you give me some ideas how this should be implemented? Thanks! NOTE: vertical stairs not standard diagonal, but vertical. Like here - Quote Link to comment Share on other sites More sharing options...
Wingnut Posted April 1, 2018 Share Posted April 1, 2018 Hiya K-doggy! https://www.babylonjs-playground.com/#Y1W3F9#6 Hold W, then later... S. Wingy goofin' around. As you mentioned in PM, it is a fairly complicated operation, indeed. Needs a supercomputer or something. :/ I'm using more actionManagers than a Rube Goldberg sewing machine. (Hey, it's Sunday here... my comedy writers have the day off and I'm wingin' it.) This PG acts pretty good. It has a momentary "float" when it leaves the top of the ladder... on a climb. And... the cambox overlaps the ladder a bit... on the way down. Perhaps you/others can improve it. Kurhlaa has stated (in PM) that e wants stop-ability, reversibility, and camera look-around freedom (later, when cam is parented to box, IF Kurhlaa allows camera to be parented AT ALL) The onEnter/onExit triggers probably won't work... without camera having a mesh either carried or ridden. Could use different collision methods, I guess. It might be nice if other forum helpers... created/tested some camera-only versions. Custom camera.input ONLY when cam/ladder are in-collision? hmm. I'll goof around with it some more if I get a chance. Hopefully, we're in the neighborhood of success. We'll talk. Quote Link to comment Share on other sites More sharing options...
kurhlaa Posted April 1, 2018 Author Share Posted April 1, 2018 Short additional info - camera's parent already is a mesh, so it is easy to look around, while moving a mesh/character. However it would be interesting to see camera-only version too, if that's possible. Quote Link to comment Share on other sites More sharing options...
Wingnut Posted April 1, 2018 Share Posted April 1, 2018 Yeah. http://doc.babylonjs.com/how_to/camera_behaviors It might be a behavior, too. "climbing behavior". hmm. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.