The idea of connecting dynamic and kinematic objects via joint is a strong solution to this problem. I use it often in Line Bot so that “shots” are not affected by gravity but can still collide with both static, kinematic, and dynamic objects all at the same time. [import]uid: 36054 topic_id: 12326 reply_id: 83133[/import]
I’m trying to use this weld joint to build a flying object. I can set my player to kinematic and then I have a hitBox that i set to Dynamic. But with the hybrid display on, I see my dynamic invisible box fall to the ground and a line drawn between the player object and the hit object.
local frames = #playerFrames
player = movieclip.newAnim(playerFrames)
player.x = 64
player.y = display.contentHeight / 2
player:play({startFrame=1, endFrame=frames,loops=-1, remove=false})
player.hitBox = display.newRect(0,0,player.width,player.height)
player.hitBox.alpha = 0.0
player.hitBox.x = player.x
player.hitBox.y = player.y
player.hitBox.isHitTestable = true
player.hitBox.name = "playerHitBox"
player.name = "player"
physics.addBody(player, "kinematic", { density = 1.0, bounce = 0.3, friction = 0.5 })
physics.addBody(player.hitBox, "dynamic", {density = 0.0, bounce = 0.0, friction = 0.0})
local myJoint = physics.newJoint( "weld", player, player.hitBox, player.x, player.y )
player.hitBox.isFixedRotation = true
player.hitBox.collision = onCollision
player.hitBox:addEventListener("collision", player.hitBox)
So with this weld joint why is my hitBox still falling to the ground? [import]uid: 19626 topic_id: 12326 reply_id: 87213[/import]
Rob - did you find a solution to this problem? I am facing something similar and am stuck… [import]uid: 135391 topic_id: 12326 reply_id: 96219[/import]
No. I ended up scrapping that idea with about a thousand others. That game made me age several years.
The collisions were just part of the problem. My biggest issues was trying to use touch-drag for something it wasn’t meant to do. You could drag too fast and blow right through objects. The touch-drag was also causing my other major problem, the Camera. It’s really hard to drag an object when the camera keeps trying to center it.
I ended up dropping drag to move and switched to a joystick (invisible, covers the whole screen) and once I got the max speed tuned just right it wasn’t blowing through things and my game became considerably simpler.
Regardless, trying to move your object outside of physics and having it react with physics is simply problematic. Almost all of us need collision detection with things that are not under physics control. Hopefully we will get that some day.
[import]uid: 19626 topic_id: 12326 reply_id: 96295[/import]
@robmiracle
Pixel perfect collision points is also needed. [import]uid: 118379 topic_id: 12326 reply_id: 96538[/import]
Turns out that welding kinematics together gets you literally nowhere too. :-S So to make them move together as a group, I had to use a Runtime enterFrame event handler. [import]uid: 63787 topic_id: 12326 reply_id: 109148[/import]
Hi
I am new in corona…can anyone help to
how to collide two object and remove on collision in corona
thanx in advance [import]uid: 233450 topic_id: 12326 reply_id: 144709[/import]
Hi
I am new in corona…can anyone help to
how to collide two object and remove on collision in corona
thanx in advance [import]uid: 233450 topic_id: 12326 reply_id: 144709[/import]
Hi
I am new in corona…can anyone help to
how to collide two object and remove on collision in corona
thanx in advance [import]uid: 233450 topic_id: 12326 reply_id: 144709[/import]
Hi
I am new in corona…can anyone help to
how to collide two object and remove on collision in corona
thanx in advance [import]uid: 233450 topic_id: 12326 reply_id: 144709[/import]