Collision Never fires - why not? - Need Help Bad

I have 2 issues

#1 the platform “collusion” never fires when it hits the left or right walls.
I have a different object that slides left and right with the transition.to and it fires the collusion functions for it.

Even if i change the platform to use transition.to is still does not fire the collision event.

#2 the platform is 100 pixels wide and i guess because the default reference point is display.CenterLeftReferencePoint it using that as it’s x position. So ( not depicted below ) in the move i actually have to calculate based on platform.x+50 or x-50 to keep the platform image in the focus of the screen, why is that?

I have hybrid mode on and can see the walls that the platform pass right through.

[code]
local leftwall = display.newRect(0,0,1, display.contentHeight)
local rightwall = display.newRect(display.contentWidth,0,1, display.contentHeight)
local ceiling = display.newRect(0,0, display.contentWidth,1)

physics.addBody(leftwall, “static”, {density=3.0,bounce = 0.1} )
physics.addBody(rightwall, “static”, {density=3.0, bounce = 0.1} )
physics.addBody(ceiling, “static”, {density=3.0,bounce = 0.1} )

local xdirection = 10

local movePlatform = function()
if (platform.x <= 0) then xdirection = 10 end
if (platform.x >= display.contentWidth) then xdirection = -10 end
platform.x = platform.x + xdirection
end

–This even NEVER fires
–local function onPlatformCollision( self, event )
local function onPlatformCollision( event )
t:setText( “onPlatformCollision-” );
if (event.object1.x <= 0) then xdirection = 10 end
if (event.object1.x >= display.contentWidth) then xdirection = -10 end
platform.x = platform.x + xdirection
end

platform.isAwake=true
platform.isSleepingAllowed = false
platform.collision = onPlatformCollision
platform:addEventListener( “collision”, platform )

–platform:addEventListener( “collision”, onPlatformCollision )
Runtime:addEventListener( “enterFrame”, movePlatform )
[/code] [import]uid: 11860 topic_id: 4515 reply_id: 304515[/import]

did you actually add your platform as a physics body?

it’s not in that code snippet.

if so, is it static? it won’t collide if it’s static. you’ll need to set isSensor=true

[import]uid: 6645 topic_id: 4515 reply_id: 14216[/import]

Yes i did

physics.addBody( platform, "kinematic", { friction=0.7 } )  
platform.name="platform"  
platform.isSensor=true  
  

sorry i missed copying the code the first time. [import]uid: 11860 topic_id: 4515 reply_id: 14401[/import]

did you fix this? i had to make my object “dynamic” not “kinematic”
http://developer.anscamobile.com/forum/2011/03/16/dropping-image-only-predefined-areas-seen-board-games#comment-28043
[import]uid: 6645 topic_id: 4515 reply_id: 28046[/import]