Thanks for all the help everyone
SO what I ended up doing:
I made an actor at the feet of the player (an almost completely transparent box) and named it feetCollision.
I set it so the feetCollision is parented to the player. If the feetCollision is colliding with the platform then oG=1;
and then if the player is colliding with the top of platform:
- Code: Select all
if(yvelocity>0)
{
if (oG ==1)
{
PhysicalResponse(MOVE_EVENT_ACTOR_ONLY, USE_CALCULATED_MASS, 1.000000, 1.000000, 000000, 1.000000);
canjump=1;
}
}
This still leaves 2 problems.
If my player is standing on one platform... and their head (or any part of their body) touches another platform this will cause the player to jump up to the higher level.
To solve this im going to make my platforms a bit differently than I have. Instead of one giant platform actor im going to make a couple individual types of platforms (2 blocks across, 3 blocks across,etc) and then clone them. I think this will make the placement of platforms much much easier anyways.
The other problem is if my player is falling really quickly the feetCollision doesnt trigger and the player will pass through the platforms. Im not sure if there is a great way to fix this... for now im going to leave it and simply make sure that the ground actor isnt dependant on feetCollision.
Ok so that is how I hacked it together. Games are all smoke and mirrors anyways. If anyone has a better solution let me know.