Sticky Platforms
Blitz3D Forums/Blitz3D Programming/Sticky Platforms
| ||
I have a 2d-ish project with a lot of platforms which move in about the X and Y. I have collisions working well with NG collision system. The only trouble is getting the player to stay on a platform and be allowed to move as well. I can position him on the platform correctly but when a few lines of code later I use translate entity to move him laterally on the X he fails to move at all in relation to the platform he just sticks to it like glue :( Is there a sort of limit to positioning and translating and entity each game loop? Do they add up together correctly? I've been at this for over 5 hours now and think it's time I asked for some help...anybody have any ideas? |
| ||
What i do is parent the character to the platform :o). DO a linepick straight down from his position. If he's no-longer on the platform, ie. the linepick returns no entity, unparent him :o) |
| ||
Thanks Ross! As a side note and because I wanted to know why my code didn't work - i found out I was calculating a player/platform offset each loop instead of only when he first collides or moves...simple when you know how. |