Importing and adding collision to .png files

So I have a guy hand drawing a bunch of 2D assets for me. And he drew me a great looking grass patch with dirt underneath it. However, I’m not really sure what the best way to import a .png file and adding collision so the player can walk on it would be. Can anyone help a newbie out? I’d like to use this platform to layout a level. Any advice would help greatly.

Help us understand what you’ve got already. Which tutorials have you gone through? How did they work out?

It’s just this standard robot character running on this patch of grass that I imported. Obviously the robot fell through it because it had no collision. So I put an edge collision on it. But I’m not entirely sure if I properly imported the grass or even came to the proper solution because when I try to put two of them together to form a path and play the scene, only the one patch that the robot starts out on is visible. The other patch of grass disappears from the screen entirely until the robot walks on it. Only then will it appear. I really haven’t been able to find any tutorials on how to fix this, but if you can point me in the right direction, I’d be greatful. Like I said, I’m pretty new to this.

OK, it sounds like you haven’t done any tutorials, but are hoping to just sort of figure it out as you go by asking questions when you get stuck — but you’re stuck on the very first step. This is going to be a long, difficult way to learn Unity.

I recommend you put your robot and grass aside for a month or two, and spend that time over at the Learn section of the site. There are a ton of useful tutorials there. You don’t have to do them all, but you should do at least 5 or 10, covering the range of topics you think you’ll need — and then plan to go back and do a few more when you discover the gaps in your knowledge you didn’t even realize existed before.

Unless you have a lot of experience programming in other environments, this will be dramatically faster than us trying to lead you through each step by forum posts.

P.S. The fact that your robot is falling at all, when you haven’t written any code yet, suggests that you’re using the physics engine. That’s fine, but it’s an extra layer of complexity I would recommend you avoid for your first game. See here for an article showing how to make a lively 2D game without the physics engine, though I suspect it may not make much sense to you just yet.

1 Like

Alright, I’ll do just that, thank you for the links.

1 Like