Friction and Platforms
seancooke
Member Posts: 9
Hey all,
The Setup...
Sidescrolling actor, it's own gravity(downward acc), 0 Friction
Non-movable Platforms, colliding with actor, 0 Friction
On my default settings I can control the actor make him jump around and onto platforms. But the platforms behave like ice (0 Friction). But if I bump the Friction(on either the actor or platform or both) to a point where the actor sticks in a natural way to the ground and platforms, he ALSO sticks to the side of the platforms if he happens to jump horizontally into them.
Now I could be blind, the forum search results for friction and platform, could be addressing this, but I might've missed it.
FMG tut's don't quite cover that yet and may be in his next one "Jumping".
Just odd, and figured it was something really simple that I was overlooking.
Thanks
The Setup...
Sidescrolling actor, it's own gravity(downward acc), 0 Friction
Non-movable Platforms, colliding with actor, 0 Friction
On my default settings I can control the actor make him jump around and onto platforms. But the platforms behave like ice (0 Friction). But if I bump the Friction(on either the actor or platform or both) to a point where the actor sticks in a natural way to the ground and platforms, he ALSO sticks to the side of the platforms if he happens to jump horizontally into them.
Now I could be blind, the forum search results for friction and platform, could be addressing this, but I might've missed it.
FMG tut's don't quite cover that yet and may be in his next one "Jumping".
Just odd, and figured it was something really simple that I was overlooking.
Thanks
Comments
You have to compare the X and Y of the platform with the X and Y of the Player.
It's pretty tedious with GameSalad, but that is the gist of it.
I will work on the next tutorial when I get some time. I've been swamped lately!
Joe
Yeah I was secretly hoping it wasn't something as processor heavy as that, but I figured it would be. I've got "treasure boxes/Mario coin blocks" plugged in and they have to run a check to see if when they collide with the player, that the player is lower than itself and inside it's horizontal borders. Guessing I was just wishing the code wouldn't have to be platform dependent and running on every platform in the scene, but rather a game setting.
Thanks for the heads up, looking forward to your next Tut!
Sean
It's either the mathematical route, in which every platform/block currently on-screen(which requires another check) is constantly checking for collisions.
Or you have to place invisible "triggers" all over the place...if you touch this trigger you can jump, if you touch this trigger you hit your head, etc...
The second way seems really ugly to me, for one you now have a million actors in the scene, and secondly, those triggers have to check for collisions as well.