Rolling ball

Hello, 

I’m trying to make a ball roll down a triangular shaped object, but the ball won’t roll actually it’s not even touching the triangular object.  By chance I came across the physics.setDrawMode( “hybrid” ) which help me see the box around the triangular object and the ball.  What are they for and how do I remove it from the triangular object?

I’ve been watching the corona university vids, but since there really aren’t any actual classes to take I’m basically just seeing what does ore doesn’t work.

I’d appreciate any help, 

Thanks

When adding the bodies, you need to provide a shape/polygon that matches the outline of your image.

The documentation shows you some examples https://docs.coronalabs.com/api/library/physics/addBody.html

Alternatively, you could try the ‘outline’ option, also documented, but I’ve not used that myself.

You will also want to read this guide: https://docs.coronalabs.com/daily/guide/physics/physicsBodies/index.html

It should get you straightened out on how physics bodies and their shapes work.

You will have to set your triangle’s body manually. However, when making it, remember that the coordinates you choose are offset from the center of the triangle. (View roaminggamer’s link)

Thanks for all the help everyone, sorry I didn’t reply sooner, but I haven’t been all that well so learning is slow going at times.

I really appreciate all the help everyone gave me.

Thank you again

When adding the bodies, you need to provide a shape/polygon that matches the outline of your image.

The documentation shows you some examples https://docs.coronalabs.com/api/library/physics/addBody.html

Alternatively, you could try the ‘outline’ option, also documented, but I’ve not used that myself.

You will also want to read this guide: https://docs.coronalabs.com/daily/guide/physics/physicsBodies/index.html

It should get you straightened out on how physics bodies and their shapes work.

You will have to set your triangle’s body manually. However, when making it, remember that the coordinates you choose are offset from the center of the triangle. (View roaminggamer’s link)

Thanks for all the help everyone, sorry I didn’t reply sooner, but I haven’t been all that well so learning is slow going at times.

I really appreciate all the help everyone gave me.

Thank you again