valueerror Posted March 25, 2014 Share Posted March 25, 2014 powerups = game.add.group(); powerups.enableBody = true; powerups.physicsBodyType=Phaser.Physics.P2JS; map.createFromObjects('objects1', 339, 'questionmark', 2, true, false, powerups);powerups.forEach(CallsignIt,this);so the physics bodyis created.. i can apply a rectangle, a body.mass, static, name... but then the "setCollisionGroup" option failes. Uncaught TypeError: Cannot read property 'mask' of undefined function CallsignIt(callsign){ callsign.body.setRectangle(64,64); callsign.body.mass=99; callsign.body.static = true; callsign.body.sprite.name="growshroom"; callsign.body.setCollisionGroup(questionmarkCG); callsign.body.collides([playerCG,fireballCG]);}i also tried it that way: (but then nothing happens)powerups.callAll('setCollisionGroup', 'null', 'questionmarkCG');what am i doing wrong? thx Link to comment Share on other sites More sharing options...
JP91 Posted March 25, 2014 Share Posted March 25, 2014 if I'm not mistaken you must create a collisionGroup and then setColissiongroup Cawrtz 1 Link to comment Share on other sites More sharing options...
valueerror Posted March 26, 2014 Author Share Posted March 26, 2014 JP91 - thank you !!! of course i created a proper collisionGroup (all my other objects are using it) but i created the "powerups" group a few lines -before- i define the collsion groups ...i don't know how i could have NOT seen this... Link to comment Share on other sites More sharing options...
Recommended Posts