Can anyone please help me out with a collision issue?
I have a mountain, and I have added a polygon around it so that the exact shape can be mapped.
However when a ball is released, it does not collide with the lines rather it bounces off the rectangular shape. This is quite unfortunate. I thought the outline will serve as boundaries for the object layer, but it is not.
Here is the video : https://screencast-o-matic.com/watch/cFXjqXYRD7
my code is :
local physics = require( “physics” )
– Start the physics engine
physics.start()
physics.setGravity( 0, 1 )
physics.setDrawMode( “hybrid” )
local berry = require( ‘ldurniat.berry’ )
local map = berry.new( ‘map_scene/Level1.json’, ‘Assets’ ) – look for images in /scene/game/map/
local myCircle = display.newCircle( 400, 50, 15 )
myCircle:setFillColor( 0.1 )
physics.addBody( myCircle, “dynamic”, {density=14.0, friction=0, bounce=0.2})
map:insert(myCircle)
The ball is not colliding with the outline of the polygon created, rather it is colliding on the outer rectangle within which the polyline object resides.
Is this a bug?