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 / Sparkys collition help

Author
Message
Daniel wright 2311
User Banned
Posted: 5th Jun 2012 01:46 Edited at: 5th Jun 2012 01:47
Can I get collition only on the top of a platform? I am using a box for the platform,I want collition for the top so I can stand on it,but not on the sides or the bottom so I can jump through it.

thanks for any help

WHOOPS,THE TITAL IS NOT SPELLED RIGHT,COULD A MOD FIX IT,THANKS

my signature keeps being erased by a mod So this is my new signature.
chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 5th Jun 2012 03:27
Hi Daniel W. Try this piece of code with your level...I`m sure you'll be able to adjusted .





Perhaps you will have to use different level scale

Cheers.

I'm not a grumpy grandpa
zeroSlave
17
Years of Service
User Offline
Joined: 13th Jun 2009
Location: Springfield
Posted: 5th Jun 2012 04:00 Edited at: 5th Jun 2012 04:04
Since you only want the collision to be in a downward direction, (I'm guessing somewhat like Castlevania's and Mario's one way platforms) you could look into SC's collision groups. Standard objects could be in group 1 which would not allow any movement through them, while one way platforms could be in group 2 which would only prevent downward motion. You'd have to put some thought into so that the player wouldn't get stuck halfway in a box if he jumped high enough to clear the bottom, but not high enough to clear the top of it.

You might also look into making a function that creates a box (without collision) and a plane (with collision) at the same time and positions them where you want. Something like:


Then you could make either an invisible plane under the character to check for collision when the character is falling , or use raycasting to only check a downward position from the character. The latter would probably work best so that the player plane would not skip the platform if the -y movement was too large.

Everybody is a genius. But if you judge a fish by its ability to climb a tree, it will live its whole life believing that it is stupid.
Daniel wright 2311
User Banned
Posted: 5th Jun 2012 04:47 Edited at: 5th Jun 2012 04:48
@zeroSlave

Good points,I think I can rename the collitions group after my player is so high,you gave me this idea,I will try it.

@chafari

Thank you,I will look at the code and let you know.

my signature keeps being erased by a mod So this is my new signature.
chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 5th Jun 2012 14:57
Quote: "Can I get collition only on the top of a platform?"


I think I`ve jumped the gun with that code ...I didn`t realize you need jump through it...sorry

I'm not a grumpy grandpa
Daniel wright 2311
User Banned
Posted: 5th Jun 2012 18:13
@chafari

Thats ok,no problem,thanks for trying at any rate.

my signature keeps being erased by a mod So this is my new signature.

Login to post a reply

Server time is: 2026-07-08 10:39:07
Your offset time is: 2026-07-08 10:39:07