Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers AppGameKit Corner / Problem with stairs

Author
Message
Kot
7
Years of Service
User Offline
Joined: 2nd Mar 2017
Location:
Posted: 4th Nov 2017 00:33
Climbing stairs is a hard thing. I must look camera up and it's very slow anyway. How can I make it like in a normal game? I know I can use ObjectSphereSlide, but if I set it too high I won't be able to fit in doors. There's somewhere a command that I can use to determine x, y and z collision radius, but it involves physics AFAIR and I don't know how to turn it on yet and what impact will it have on game performance (btw, help file sucks for the price it should be better IMHO, not "buy the books").
Cybermind
Valued Member
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: Denmark
Posted: 4th Nov 2017 10:05
You could make stairs a zone where you set the desired value for ObjectSphereSlide, and when leaving the zone, set it back to what you need to fit through doors.
13/0
Rick Nasher
6
Years of Service
User Offline
Joined: 25th Jul 2017
Location: Amsterdam
Posted: 20th Nov 2017 21:23 Edited at: 5th Dec 2017 21:34
What if the stairs need to be same size of the doors?
Van B
Moderator
21
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 21st Nov 2017 13:56
A lot of engines prefer to just ignore the complexities of stairs, and use a slope for collision instead - I would suggest making a collision only version of your building, with minimal polygons and slopes instead of stairs. If you use that for collision, it's faster, far less likely to stick, easier to negotiate slopes than stairs etc.

I would probably just use a shorter capsule or a sphere for the bottom half of the character, rather than a capsule or sphere that is the same height. You could even just change your collision version of the building, so it allows for the torso height - like, if you have an area that you don't want the player to jump in, you make the ceiling shorter, so the collision sphere will hit the roof where the players head would be... so as far as your game is concerned, the player is a sphere. If the sphere is 3 feet diameter, and the player is 6 foot tall, and the roof is 8 foot tall, then the actual roof on your collision mesh would be 5 foot tall (leaving 2 foot for jump space).
The code is dark and full of errors
Stab in the Dark software
Valued Member
21
Years of Service
User Offline
Joined: 12th Dec 2002
Playing: Badges, I don't need no stinkin badges
Posted: 22nd Nov 2017 01:59
You could just use the 3D physics character controller it has step height built in.
The coffee is lovely dark and deep,and I have code to write before I sleep.
Kot
7
Years of Service
User Offline
Joined: 2nd Mar 2017
Location:
Posted: 29th Nov 2017 09:45
Thanks for your answers, I'll check them for sure (they look great and promising - any code example for 3D physics character controller?), but I probably found a simpler solution that I'm still testing - after closer analysis of the example delivered with AppGameKit I noticed that the collision sphere is quite small, but the camera view is elevated high. After lowering camera elevation I can enlarge collision sphere to be able to climb the stairs. Still testing.
Stab in the Dark software
Valued Member
21
Years of Service
User Offline
Joined: 12th Dec 2002
Playing: Badges, I don't need no stinkin badges
Posted: 29th Nov 2017 21:38
Quote: "any code example for 3D physics character controller?), "


https://forum.thegamecreators.com/thread/216683
The coffee is lovely dark and deep,and I have code to write before I sleep.
pavel_sv_1982
11
Years of Service
User Offline
Joined: 9th Apr 2013
Location: Russia
Posted: 4th Dec 2017 06:35 Edited at: 4th Dec 2017 12:05
Stab in the Dark @
You are a genius. A funny video.
funny video about the 3D physics character controller.

Login to post a reply

Server time is: 2024-04-19 04:27:28
Your offset time is: 2024-04-19 04:27:28