"object.isBullet = true" doesn't help

Hello everyone,
I already set my object’s property “isBullet” to true, but it kept passing through other objects. Any suggestion? [import]uid: 33695 topic_id: 9288 reply_id: 309288[/import]

How’s the density on the objects that you wanted to
Stop the fast moving object?? [import]uid: 12455 topic_id: 9288 reply_id: 33892[/import]

in what speed ur object is moving it must be toooooo much fast to detect collition [import]uid: 12482 topic_id: 9288 reply_id: 33893[/import]

teex84, Does the density of the object affect this?
And my object is supposed to be fast, like a cue ball must be fast to hit other balls and hit them with a strong force, just like a bullet must be fast, so the high speed is required for my game. [import]uid: 33695 topic_id: 9288 reply_id: 33895[/import]

hgvyas123, do you mean that if the speed of my object is too fast, the detecting collision fail? If this is true, i have to adjust the velocity of my object. I didn’t find any information about this in the api reference. The object in a game is supposed to have certain velocity, right? I just don’t know why velocity matters.
[import]uid: 33695 topic_id: 9288 reply_id: 33898[/import]

hgvyas123, OK, let me try. [import]uid: 33695 topic_id: 9288 reply_id: 33901[/import]

can’t you adjust it some what low to feet for both [import]uid: 12482 topic_id: 9288 reply_id: 33900[/import]

hgvyas123, I applied force for my object (using object:applyForce() ), so it didn’t set the velocity for it in the beginning. Meaning, the object had the initial speed depending on the magnitude of the force applied for it. So, now how can i change its velocity?. The object is flying and is nearing to hit other object, if using method setLinearVelocity, how can i set the velocity properly? [import]uid: 33695 topic_id: 9288 reply_id: 33902[/import]

can you plz post the code or something similar to that so i can review [import]uid: 12482 topic_id: 9288 reply_id: 33903[/import]

This is onScreenTouch event, when you touch the object and drag it and then let go, the object is fired, it will fly and is ready to hit other objects
local onScreenTouch = function( event )
if event.phase == “ended” then

local x = event.x
local y = event.y
local xForce = -(x - object.x) * 2
local yForce = -(y - object.y) * 2
object.bodyType = “dynamic”
object.isBullet = true
object:applyForce( xForce, yForce, object.x, object.y )
end

end

[import]uid: 33695 topic_id: 9288 reply_id: 33904[/import]

works perfect and gives you collition
[lua] local physics = require “physics”
physics.start()
physics.setGravity(0,0)
local localGroup = display.newGroup()

local obj1 = display.newCircle(0,0,15)
obj1.x = 250
obj1.y = 150
physics.addBody(obj1,“dynamic”,{density = 1,bounce = 0.7})

local line1 = display.newRect(100,60,300,10)
local line2 = display.newRect(100,260,300,10)
local line3 = display.newRect(100,60,10,200)
local line4 = display.newRect(400,60,10,200)
physics.addBody(line1,“static”,{density = 1,bounce = 0.7})
physics.addBody(line2,“static”,{density = 1,bounce = 0.7})
physics.addBody(line3,“static”,{density = 1,bounce = 0.7})
physics.addBody(line4,“static”,{density = 1,bounce = 0.7})

local function onLocalCollision( self, event )
print(“coll detected”)
end
obj1.collision = onLocalCollision
obj1:addEventListener( “collision”, obj1 )

local function force()
obj1:applyForce(1000,1000,obj1.x,obj1.y)
end
obj1:addEventListener(“tap”,force)[/lua] [import]uid: 12482 topic_id: 9288 reply_id: 33908[/import]

hgvyas123, my being hit objects are not “static” like your line 1, and line 2 , they are dynamic, they can move. If I increase the force, it will pass through others. I think my solution for now is limit the drag action of user’s finger, so the force won’t be too strong. [import]uid: 33695 topic_id: 9288 reply_id: 33910[/import]