I’m messing around with the Game Edition, and trying to figure out different types of collisions.
I have a platform that is rotated -60 degress like: / and It moves left and right. When I drop the ball and it collides with the platform as it is moving left, the ball moves up the platform, which I don’t want to happen at all.
It seems that no matter what density/friction I set, I can’t ever get the ball to act normal, the collisions and movement always seems erratic with the moving rotated platform.
I’ve been playing around with this, and when I rotate the platform to 90 or 270 degrees (so that It is vertical) if the ball collides with the platform, then it *sticks* to it.
Can anyone offer any support? Here is my code:
[code]
local onRight
local onLeft
function onRight( movingPlatform )
transition.to(movingPlatform,{time=2000,x=60,onComplete=onLeft})
end
function onLeft( movingPlatform )
transition.to(movingPlatform,{time=2000,x=260,onComplete=onRight})
end
I had the same problem. I think it has to do with the Physics engine not cooperating with translate movements or rotation movements. Try setting the object’s AngularVelocity to rotate it instead.
Yes, in general you want to avoid using using transitions with physics objects. In this case, you might use setLinearVelocity() on the platform object instead of transition.to.