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.

DarkBASIC Professional Discussion / hard question 4 expert coders

Author
Message
David iz cool
20
Years of Service
User Offline
Joined: 21st Sep 2005
Location: somewhere lol :P
Posted: 9th Feb 2011 18:08 Edited at: 9th Feb 2011 18:08
how would u code your player grabbing the edge of any mesh????
like after jumping up 2 it

like in tomb raider????
Madscientist
16
Years of Service
User Offline
Joined: 23rd Aug 2009
Location: Between a rock and a hard place
Posted: 9th Feb 2011 18:51
Baiscally you could make an invisible map made of boxes. The boxes would be where the edges in your map would be. Then check collision between the player and the box map. If there is collision, play the animation of the player hanging and position him accordingly.

Diggsey
20
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 9th Feb 2011 19:19
Alternatively, cast short rays vertically down from where the player's hands would be. If the rays hit something, and the normal is close enough to vertical, there is a ledge which can be hung off.

[b]
David iz cool
20
Years of Service
User Offline
Joined: 21st Sep 2005
Location: somewhere lol :P
Posted: 9th Feb 2011 20:04
i appreciate both ideas but the cast ray from hands i never thought of that!! thanks alot diggsey!!

i hope it works lol!

but 1 thing i heard casting rays takes alot of computational power,is that true??
Diggsey
20
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 10th Feb 2011 01:11
No, raycasting is very fast. If you use sparky's dll you won't notice any slow-down even if you do hundreds of raycasts each frame.

[b]

Login to post a reply

Server time is: 2026-07-16 04:35:37
Your offset time is: 2026-07-16 04:35:37