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 / Collision?

Author
Message
Tylerman35
15
Years of Service
User Offline
Joined: 23rd Jul 2009
Location:
Posted: 10th Aug 2009 06:59
how can i make a collision before going off my terrain so i cant get off my terrain?
MikeS
Retired Moderator
21
Years of Service
User Offline
Joined: 2nd Dec 2002
Location: United States
Posted: 10th Aug 2009 08:30
Check to see if your objects position is less than the size of the terrains absolute(or global) X and Z coordinates in the world, or greater than the absolute X and Z coordinates. If these conditions are satisfied, then restrict your characters movement.





A book? I hate book. Book is stupid.
(Formerly Yellow)
Caleb1994
15
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 11th Aug 2009 21:25 Edited at: 11th Aug 2009 21:25
Well you don't need to "Restrict" the movement.

in the same if as your movement code just add a "Out of bounds" check and then if its true don't add to the X/Z value and if it's false then add to it.

New Site! Check it out \/
Zuka
16
Years of Service
User Offline
Joined: 21st Apr 2008
Location: They locked me in the insane asylum.
Posted: 12th Aug 2009 00:50
Caleb, if you do that, you'll get stuck. If you go out of bounds, how do you get back in bounds if you can't move?

Login to post a reply

Server time is: 2024-10-01 10:28:15
Your offset time is: 2024-10-01 10:28:15