Quantcast
Channel: Questions in topic: "follow"
Viewing all articles
Browse latest Browse all 536

Main Camera child under player, causes flip

$
0
0
I am building a 2d platformer, and I have my movement script complete; however I wanted the main camera to follow my character throughout the level, so I thought the best way to do this would be to place the camera as a child object under my player in the hierarchy. That way the camera moves alongside the player. This works alright except for in my player Movement script I use "transform.eulerAngles = new Vector2(0,180);" in order to flip the character when walking the other direction. When the camera is a child of the sprite, it flips the camera as well. Is there a way to do this without causing the camera to flip? On a side note would it also be possible to make the camera follow the player, but only in the x or y planes? Thanks for any help you can provide

Viewing all articles
Browse latest Browse all 536

Trending Articles



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