Object Moves Through Wall (with enough tilt)

Hi…new to Corona…

I have created a static wall in which an object is to bounce off (like it does with the floor). However, with enough tilt, the object begins to go through the wall, eventually moving through it. Any suggestions of what I need to add in order for the wall to act as intended?

Thanks in advance! [import]uid: 12894 topic_id: 5100 reply_id: 305100[/import]

try setting .isBullet=true on the object

[import]uid: 6645 topic_id: 5100 reply_id: 16814[/import]

Thanks! [import]uid: 12894 topic_id: 5100 reply_id: 16824[/import]

I’ve got this same problem!
In the simulator, the object just gets ‘sticked’ to the wall and when I try move it the other way I’m forcing it to leave the wall

And on the device with enough tilt the object moves right through it…

I’ve tried setting isSleepingAllowed to false, a suggestions from another thread, and isBullet=true both don’t work… [import]uid: 14018 topic_id: 5100 reply_id: 19130[/import]

I second NahirC. I have the same problem even after attempting the same solutions. In addition, I have an animated moving wall that the object sticks too when they collide. Any Solutions? [import]uid: 23733 topic_id: 5100 reply_id: 19262[/import]

same problem here! I was going to purchase corona tonight and still might, but this is very disappointing. Anybody else have any solutions? [import]uid: 7116 topic_id: 5100 reply_id: 19343[/import]

Me too! And walls are important in my game… Nobody with a solution? [import]uid: 30185 topic_id: 5100 reply_id: 19398[/import]

Might we hear from someone over at Ansca? [import]uid: 7116 topic_id: 5100 reply_id: 19582[/import]

I’d appreciate that too [import]uid: 30185 topic_id: 5100 reply_id: 19591[/import]

This is a solution that I received from PeachPellen. It “solves” the problem (keeps the ball on the screen), but there should be an actual solution in which the walls actually do their job. At any rate, I was very appreciated of this method…this should keep the ball on the screen as you try other things:

Note: in landscape mode (basically, if it tries to leave the screen and exceeds the end value…it keeps it on screen) my values work for me…(you may want to 0 instead of 20, etc.)
---- Keeps balloon on screen

local function keeponscreen (event)

if balloon.x < 20 then
balloon.x = 20
end
if balloon.x > 460 then
balloon.x = 460
end
if balloon.y < 0 then
balloon.y = 0
end
if balloon.y > 320 then
balloon.y = 320
end
end

Runtime:addEventListener(“enterFrame”, keeponscreen)
If you, or anyone else reading has a very simple tutorial on collisions. I would appreciate it! I have been stuck for weeks just trying to get a ball to collide with a red box and have something happen, and if it collides with a blue box have something else happen. Any help would be appreciated! [import]uid: 12894 topic_id: 5100 reply_id: 19635[/import]

Thanks alot William, this does the job beautifully! But yeah, walls should be fixed…

For collision. This is the code you’d want to use:

local function functionName(event)  
 if(event.phase == "began") then  
 local variable = display.newText("Hi")  
 end  
end  
collidingObjectName.collision = functionName  
collidingObjectName:addEventListener("collision", functionName)  

What this code does, is it creates a function that is triggered every time your colliding object collides. IF, the event is in the phase “began”, then whatever inside that if-statement happens. Lastly in that code we tell the program that collidingObjectName’s collision attribute IS functionName. They are the same thing, when collidingObjectName collides, then functionName. And then we add an event listener that keeps checking this function over and over forever.

If you want something to happen when an object collides with a specific thing for example that blue box, then all you need to do is give the blue box a class:

blueBox = display.newImage("bluebox.png")  
blueBox.class = "blueBox"  

then simply add this to the first code:

if(event.phase == "began" and event.other.class == "blueBox") then  

:)/Pjer [import]uid: 30185 topic_id: 5100 reply_id: 19653[/import]

Thanks! New to Corona…and I typically need to see something on a very small scale before I can apply it to larger things.

Is this what you had in mind?

local function functionName(event)
if(event.phase == “began” and event.other.class == “blueBox”) then
local background = display.newImage (“background2.png”)
end
end
balloon.collision = functionName
balloon:addEventListener(“collision”, functionName)

Am I missing something? Is there a particular place that I should put it in the code? [import]uid: 12894 topic_id: 5100 reply_id: 19661[/import]

That’s right. You can put the code anywhere as long as it’s outside other functions or other if statements, if you want the collision to be active all the time that is

That workaround for the wall issue is buggy btw. It makes it hard to make the ball slide along the wall. Does nobody have a solution to this issue? How do people create simple ball games with working walls?! [import]uid: 30185 topic_id: 5100 reply_id: 19681[/import]

Any real solution to this yet? My objects are moving through walls like there’s no tomorrow [import]uid: 30185 topic_id: 5100 reply_id: 20600[/import]

Come on! I’ve e-mailed support with no response for 3 days now [import]uid: 30185 topic_id: 5100 reply_id: 21191[/import]

I’ve given up on Corona for now. In the mean time, I’ve finished a smaller project using Xcode. I hope to come back to my Corona project…I do see promise in Corona. However, I need more tutorials of small projects so that I can grasp some of the features (collisions are still giving me problems). [import]uid: 12894 topic_id: 5100 reply_id: 21339[/import]

I am having the same problem. Our objects go right through the walls with enough collision. They are set to isBullet = true, a density of varying amounts up to 100, and still they just go right through other objects.

Ansca Staff, please reply to this thread! [import]uid: 10839 topic_id: 5100 reply_id: 30393[/import]

Can anyone post some example code? Perhaps a small example that you’re working on?
[import]uid: 13780 topic_id: 5100 reply_id: 30449[/import]

The game I worked on which currently got approved and is on sale
DraggingPhysics does not uses tilt but has a lot of collision and ill try
help as much as possible with this problem.

in DraggingPhysics I gave all my walls bounce physics to avoid this
you can set the bounce to very low like 0.1 or 0 and it seem to work.

My current Project uses Tilt and has a lot of walls and there is a few things
you can try because my object does not goes through walls even with enough
tilt.

Here some thing you might want to try:

1: change the numbers around density bounce friction damping ect…

2: add physics to your walls (bounce worked great)

3: lower the velocity of your tilt

4: you can always follow post #9 in your codes it will prevent this
(but depends on how your game is design)

Im currently not on my project atm so I hope this helps if not I will try post
few codes to get you going or if you can post your code I can help you out.
You can always send me an email to leivagames@gmail.com and I will try help
you out as much as possible Good Luck! [import]uid: 30314 topic_id: 5100 reply_id: 30455[/import]

Guys, any word on this? I’m having this issue as well for two fast moving object that should collide but do not.

Both have isBullet=true

My example is a moving ball getting hit by a rotated bat. The bat goes right through the ball sometimes.

Help? [import]uid: 52627 topic_id: 5100 reply_id: 37743[/import]