- Home /
2D Physics moving platform with circle collider
I'm having a strange issues where I have a platform that's moving, and an object with a circle collider that falls on top of it.
When the platform moves, the circle collider (and all other colliders) just stays in place, as if the platform where made of ice. I made a similar project in Cocos2d using Box2d and it behaved differently, more how I would expect, ie the circle collider rotating in place when the platform below it moved.
Any ideas how to fix this? I've tried a 2d Physic Material with a bunch of friction on it, but that didn't do anything.
Thanks.
Answer by nasa8 · Dec 05, 2013 at 07:12 AM
I'm using Unity 4.3 and everything works fine! I've just tried!
I think the problem is in the way you move your platforms. Don't move your platforms changing transform.position or transform.Translate(), move them by changing ridgitbody2D.velocity or by ridgitbody2d.AddForce(). So In your case platform should have ridgitbody2D as well as your circle. Your circle needs ridgitbody which will be affected by gravity and the platform needs ridgitbody because you have to use velocity property. Also don't forget to specify friction parameter i.e = 10
This is exactly what I needed to do!!
Still a Unity/program$$anonymous$$g noob, had no idea I should be moving the rigidbodies, makes a lot of sense.
Thank you so much! Works perfectly now :)
Your answer
Follow this Question
Related Questions
Issues with 2d Player controller(Kinematic) 0 Answers
Physics.Simulate not working in Editor (or Play Mode) 0 Answers
2D collisions not showing all contact points 0 Answers
Bullet Trail not destroying on collision 0 Answers
2D Detect collisions of a 2D block only on left/right (not top/bottom) 0 Answers