So i'm making an rpg game in xna. I can move my player around the screen, however it can also move off the screen. How can I implament a simple camera that will follow the player and prevent them from moving off of the screen? I only need it to follow, not zoom or rotate or anything like that.

Any responses will be greatly appreciated!

Recommended Answers

place this script on your camera
transform.position = new Vector3(player.transform.x,y,z)

Jump to Post

All 2 Replies

place this script on your camera
transform.position = new Vector3(player.transform.x,y,z)

Cheers buddy, actually had this solved for a few days, just forgot about the post! Thanks anyway!

commented: hehe cheers +3
Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.