I’ve got a function that spawns scooters that zip across the screen at random heights and intervals. With my code as is, they bunch-up and bound off each other when their shapes overlap, and I want to take this effect away. I never wanted to use physics in my game at all, but was forced to, in order to create custom sized hit-boxes for my scooters (sprites) that were way smaller than the bounding boxes of the scooters. Here’s the code for my function:
local function scooterSpawn (event) timer.performWithDelay(math.random(20,35),squareSpawn) local scooter = spriteFactory:newSpriteGroup('Scooter 1 moving right') scooter:addPhysics(physics,'dynamic',{}) scooter.x = -100 scooter.y = math.random(120,924) physics.addBody(scooter,"dynamic",{isSensor = true}) transition.to(scooter, {time = math.random(1400,1500), delay = 0, x = scooter.x + 968, onComplete=function() scooter :removeSelf() end}) end timer.performWithDelay(0,scooterSpawn,1)[/code]Note that it's line 4 that starts the problems. If I remove it, my scooters just have their usual bounding box around them (what I don't want), and they can pass through each other as if transparent (what I do want). Once I add it, the bounding boxes are replaced with the custom sized hit-boxes I created (what I want), but now the physics effects come into play (what I don't want). Any solutions?Thank youSteven [import]uid: 79394 topic_id: 14471 reply_id: 314471[/import]