Hi, I just recently, as in today, found out about Corona. I’m using the trial ware and I’m trying to figure out a problem I’m having. I defined a rectangle display.newRect() that I can move around using a touch event, and then I added physics and had a crate drop from the top of the application. I don’t want this rectangle to be part of the physic world so I read the docs and it said to use physics.addBody( rect, { isSensor=true} ) so that the object will send a collision message but not interact with the object.
The problem is I have a ground defined but as soon as the game starts this rectangle which is newRect falls through the world, pass the ground into oblivion. If I add physic parameters to this rectangle it falls to the ground, not phase through the ground.
Am I understanding the function of isSensor correctly? I want an invisible trigger, which doesn’t move or interact with the world, in which I can handle an event by something else passing through it, this time a rectangle, and have that call the collision handler and do whatever inside of it.
Thanks again, and I’m looking forward to getting to know all of you. [import]uid: 10832 topic_id: 3250 reply_id: 303250[/import]
physics.addBody( recti, “static”,{})
you need to add the static option [import]uid: 7911 topic_id: 3250 reply_id: 9645[/import]
Ps welcome to corona vie been here for about 3 weeks and loving it [import]uid: 7911 topic_id: 3250 reply_id: 9647[/import]
Hello, you still have to specify a body type even if it is a sensor object. Body types include:
-
dynamic (default); will react to gravity
-
static; will not react to gravity
-
kinematic; probably the least used
I suggest trying this:
physics.addBody( rect, “static”, { isSensor=true} )
Also, welcome to Corona!
UPDATE: Looks like jstrahan beat me to it! [import]uid: 7849 topic_id: 3250 reply_id: 9646[/import]
Wow, I am very impressed with the quickness and thoroughness of your replies. Plus, they were very polite and welcoming as opposed to ‘RTFM the manual nub’. I did RTFM but all I saw was a reference to isSensor and that didn’t have ‘static’ in it. Thank you for the answer, can’t wait to try it when I’m off work.
@jstrahan I’ve been here literally for 3 hours, when I posted this question, and I’m loving it! The product looks solid and the community is great. And, thank you for the welcome.
The only thing I would recommend is better search. I tried entering isSensor and only came up with the example in the online manual that didn’t have a body type assigned.
*EDIT* I’m stupid I noticed that there is a separate search box for the forums on the forums. [import]uid: 10832 topic_id: 3250 reply_id: 9683[/import]
I find that reading through the API is very helpful in fact I keep them open in a tab the whole time [import]uid: 7911 topic_id: 3250 reply_id: 9686[/import]
I use a Firefox plugin called ‘ScrapBook’ which allows me to save a webpage to a separate ‘ScrapBook’ menu in the browser (it’s placed right next to bookmarks), and what I did was open up every page of the documentation (there’s not THAT many, and I skipped on the one’s labeled “Corona (old)” and then saved it with Scrapbook.
It gives me offline access, and then when I need to look something up real quick, it loads MUCH faster than usual. The only downside is you have to re-do it every so often if you want to make sure they’re updated, but like I said, there’s not that many separate pages so not too bad. [import]uid: 7849 topic_id: 3250 reply_id: 9704[/import]
Thanks for the tip, and good games jonbeebe. It is exciting to know that you still give back and participate with the community. I hope I can just receive a fraction of the success you have, but I’m mostly doing this as a hobby and/or resume builder. I just want to be able to say ‘look at what I’ve done’. [import]uid: 10832 topic_id: 3250 reply_id: 9722[/import]
@scontapay: Thanks for your comments! I’m glad you like our games and I wish you the best of luck with your projects, maybe it’ll turn into something more than just resume stuff one of these days, who knows? 
Anyway, if you’re on twitter, we’re @beebegames … feel free to send a tweet and we’ll be sure to follow you back. [import]uid: 7849 topic_id: 3250 reply_id: 9738[/import]