Question by
Eagle-Bound · Jun 11, 2016 at 07:12 PM ·
spritenoobsolid
Solid Object in 2D
I am very new to unity, I have been using it for only a few weeks or so. In my game I have a sprite and a tree, but my player can walk through it. I have looked through other questions, but I have had no luck making the tree solid. If anyone can explain how to make a sprite solid so another cannot pass through it in very simple terms, it would be much appreciated.
Comment
add Collider2D component to your tree GameObject and make sure both player and tree are positioned at the same Z coord.
Answer by tanoshimi · Jun 11, 2016 at 10:14 PM
I really recommend you step through some tutorials - they're all very well explained: https://unity3d.com/learn/tutorials/topics/2d-game-creation/collider-2d