Quantcast
Channel: Questions in topic: "walk"
Viewing all articles
Browse latest Browse all 88

Need advice on 2D Physics walk (local Force?)

$
0
0
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][1]. ![alt text][2] ![alt text][3] 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! [1]: http://unity3d.com/learn/tutorials/modules/beginner/2d/2d-overview [2]: /storage/temp/36226-example1.jpg [3]: /storage/temp/36227-example2.jpg

Viewing all articles
Browse latest Browse all 88

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>