When You Model A World, How Does The Player Stay On The Ground, Walk Over Steps?
When making a model,
how can you get the player to walk over
certain things like steps, etc.. ?
~ Developing the futures games, in yesterday's time ~
Easiest way is to change the player''s Y position relative to the terrain''s height.
- CheeseMonger
- CheeseMonger
- CheeseMonger
This is really a programming question, not a visual arts question.
Getting the player to stay on the ground is as simple as applying gravity, causing him to fall downward, then checking for collisions with the ground surface, or any surface that he can walk upon, and halting his fall upon such a collision. To get him to walk up stairs or ramps, calculate the new position as if he were walking straight forward, then translate this new position vertically by some maximum STEP_UP value. At this new stepped-up position, check for collision. If the player will collide with an object at this location, then it is too high for him to step up on. If there is no collision, move the player to the new location, then drop him down until he touches the surface.
It''s not really as simple as that, but that''s the basic idea.
Golem
Blender--The Gimp--Python--Lua--SDL
Nethack--Crawl--ADOM--Angband--Dungeondweller
Getting the player to stay on the ground is as simple as applying gravity, causing him to fall downward, then checking for collisions with the ground surface, or any surface that he can walk upon, and halting his fall upon such a collision. To get him to walk up stairs or ramps, calculate the new position as if he were walking straight forward, then translate this new position vertically by some maximum STEP_UP value. At this new stepped-up position, check for collision. If the player will collide with an object at this location, then it is too high for him to step up on. If there is no collision, move the player to the new location, then drop him down until he touches the surface.
It''s not really as simple as that, but that''s the basic idea.
Golem
Blender--The Gimp--Python--Lua--SDL
Nethack--Crawl--ADOM--Angband--Dungeondweller
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement