Hi All,
i need some advice on implementing better a better walk system using 2D physics.
I have implemented a solution in the same way as demonstrated in the tower bridge defence demo but i have found that this type of motion causes problems when my character is walking on movable objects as my character pushes the objects in a direction rather than walking on top of them… this is especially evident on sloped surfaces or swinging platforms, as the objects can be pushed uphill in a highly unnatural way… i’ve included two screenshots showing how you can quickly build a swinging platform to replicate the issue by modifying the Tower Bridge Defence example explained here.
Does anyone have any ideas on how i can combat the undesired motion? the project I am making requires that i continue using the physics engine for movement, and i am mostly very happy with the results that i am getting aside from this issue…
It seems to me like a possible solution would be to apply a local left or right force that is parallel to the slope of the terrain that my character is standing on?, rather than one that is set to a fixed axis… Is anyone able to comment on whether i am on the right track with this?
I’m thinking that i might try to detect the edge of the collider that my character is colliding with and use the two endpoints of that edge as a reference to get the ground angle?
has anyone run into similar issues before?
Thanks!