Quantcast
Channel: Questions in topic: "collider 2d"
Viewing all articles
Browse latest Browse all 148

Returning a Box Collider to it's orginal position

$
0
0
I'm creating a 2D game that requires a player to slide under certain obstacles, I've got the animation to play at the correct time what I'm struggling with is actually making sure the models box collider can duck under the destroying collider, I can get it to move down but it seems no matter what I do it won't return to it's original position, any help appreciated, I've tried quite a few things so I'm open to changing how the collider moves too. void Slide() { BoxCollider2D bc2d = GetComponent(); bc2d.center += new Vector2(0, -1); anim.Play("Sliding"); }

Viewing all articles
Browse latest Browse all 148

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>