Quantcast
Channel: Questions in topic: "mirror"
Viewing all articles
Browse latest Browse all 397

2d problem with mirrored sprites.

$
0
0
Im creating a 2d shooter. I wrote a script that says that if my gun's eulerangle is less than 270, but greater than 90, it will change its sprite. Script: var Gun : GameObject; var newSprite : Sprite; function Update () { if(Gun.transform.rotation.eulerAngles.z < 270 && Gun.transform.rotation.eulerAngles.z >90) { GetComponent(SpriteRenderer).sprite = newSprite; } } I put this script on player's body, gun ,head and legs. But when it switches sprites, sprites appear on diffrent positions. I make sprites on photoshop. Maybe the problem is that I create random picture sizes when I mirror my sprites? Please help.

Viewing all articles
Browse latest Browse all 397

Latest Images

Trending Articles



Latest Images

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