Shaw358
Shaw358

Reputation: 23

Why is my character flying off in unity 2d?

When i Click on the play button my Spire flies off into the ceiling of my map.

I have a simple png as a sprite in unity.
I use a tilemap for the level i made which has a TilemapCollider2D and a BoxCollider2D.

https://i.sstatic.net/PDoDu.jpg <- photo of what is happening.

My character has a BoxCollider2D and a Rigidbody2D.
I'm making a side scroller in case that is necessary to know.

The gravity and stuff for the character is normal and so is the mass.

My character(s) should just stay on the ground.

Upvotes: 0

Views: 1176

Answers (1)

Julian Chin A Foeng
Julian Chin A Foeng

Reputation: 15

I'm not exactly sure if the grey part of the backroud is the object that has a BoxCollider2D but if it does that that's your issue.

You can't have two BoxColliders overlapping each other otherwise you'll get what your seeing now, one shooting up.

I would suggest removing the BoxCollider2D on the tilemap (if that's possible) and maybe just having a BoxCollider2D on that floor in the picture.

If my answer didn't help or wasn't good enough I would be happy to help you further, just reply to this. :)

Upvotes: 1

Related Questions