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.

Dark GDK / Having Problems with Terrain Collision

Author
Message
Mr Mike
16
Years of Service
User Offline
Joined: 8th Jul 2008
Location:
Posted: 9th Jul 2008 06:07 Edited at: 9th Jul 2008 07:40
I created a Terrain Collision code so that a player walks on top of the terrain and it works just fine. However, if I add another piece of terrain and try setting up the collision with that piece, the terrain collision will only work with the new piece and wont work with the original. Does anyone have any idea how to make the collision work with both pieces?



HEYYYY YYYOOUUUUU GUUUYYYYSSSS
Zuka
16
Years of Service
User Offline
Joined: 21st Apr 2008
Location: They locked me in the insane asylum.
Posted: 9th Jul 2008 21:35
It's not checking which piece of terrain it's over. It's positioning the player at the original ground height, then the new ground height simultaneously.

Mr Mike
16
Years of Service
User Offline
Joined: 8th Jul 2008
Location:
Posted: 10th Jul 2008 00:00
I am really new and I have no idea how to make it check which piece of terrain is it over.

HEYYYY YYYOOUUUUU GUUUYYYYSSSS
SunDawg
19
Years of Service
User Offline
Joined: 21st Dec 2004
Location: Massachusetts
Posted: 10th Jul 2008 07:10
The quick, and in my opinion lazy method would be to ensure that at no point your terrain's height is 0. Then, you would simply add two new if statements replacing the code that adjusts the player's height.


The correct way to achieve what you'd like to achieve is to check if the player's X and Z coordinate's are within those of the terrain's, but this would work as a quick fix, while you hammer a better way out.


My site, for various stuff that I make.
Mr Mike
16
Years of Service
User Offline
Joined: 8th Jul 2008
Location:
Posted: 10th Jul 2008 09:09
Thanks so Much its working great

HEYYYY YYYOOUUUUU GUUUYYYYSSSS

Login to post a reply

Server time is: 2024-11-20 15:39:30
Your offset time is: 2024-11-20 15:39:30