How to make Tiled objects collide with the ones on the scene?

Hi everyone!
Corona newb here. I’ve been struggling with this problem for almost a week now with almost no effect, and it starts to look like I’m simply wasting time. Here’s what I’m trying to do: I use Tiled for making maps that have objects on them - how the hell do I get these objects to collide with the ones I create on the scene? There’s close to zero information about this online and Sticker Knight’s code doesn’t help at all, I tried copying it with no effect, got zero clue about how it works there. Can anybody please explain to me how do I do this? I already converted the objects to a physics body. My latest attempt was the following: I added all of the objects from the map to an array in ‘scene: create’, but when I run a for loop on it, the Simulator tells me the array is nil! How the heck can it be if I successfully print out the length of the array right after I put it all to the array?!

You probably need to post what you have so far, otherwise people are just going to be fumbling around in the dark.

I’ll post that as I’ll get back to my PC, but I can’t see much sense in it, to be honest. A simple advice on how is done is more than enough.

Well, the short answer is they all need to be physics bodies and added to the same display group. If you’ve done that, then there is something else wrong that can’t be answered without seeing the code.

Your issue with the array sounds like a scope problem, but again difficult to confirm without seeing what you’re doing.

You might want to look through these videos:

https://www.youtube.com/playlist?list=PLhE_IYaXVf9v7ZRMWQqvCN6dbdTD3YWMn

Rob

Thanks, Nick and Rob, my problem is solved. Although I’ll still have a look at those videos, because the problem was that I didn’t put both object types to the same display group. Absolutely forgot about that. Thanks a lot, would have never thought about it.
But there’s another problem that has emerged, and I don’t want to spam the forum with another newb question, so I’ll ask it here: how do I address objects in parent scene? I copied the Sticker Knight code again, and it just doesn’t work the same way. I’ll get to my PC soon and send snippets of my code.

You probably need to post what you have so far, otherwise people are just going to be fumbling around in the dark.

I’ll post that as I’ll get back to my PC, but I can’t see much sense in it, to be honest. A simple advice on how is done is more than enough.

Well, the short answer is they all need to be physics bodies and added to the same display group. If you’ve done that, then there is something else wrong that can’t be answered without seeing the code.

Your issue with the array sounds like a scope problem, but again difficult to confirm without seeing what you’re doing.

You might want to look through these videos:

https://www.youtube.com/playlist?list=PLhE_IYaXVf9v7ZRMWQqvCN6dbdTD3YWMn

Rob

Thanks, Nick and Rob, my problem is solved. Although I’ll still have a look at those videos, because the problem was that I didn’t put both object types to the same display group. Absolutely forgot about that. Thanks a lot, would have never thought about it.
But there’s another problem that has emerged, and I don’t want to spam the forum with another newb question, so I’ll ask it here: how do I address objects in parent scene? I copied the Sticker Knight code again, and it just doesn’t work the same way. I’ll get to my PC soon and send snippets of my code.