Last active
August 29, 2015 14:22
-
-
Save Henry-E/ce1e806b094b4a5254eb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// this needs to go into the asteroid's update function. | |
// It might be prudent to store the gameHeight and gameWidth variables | |
// in the GameManager script and assign them to variables in this | |
// script on awake. | |
// I'm neglecting to add any initialisation here but I'm sure you know what to do | |
aWidth = GameManager.instance.gameWidth | |
aHeight = GameManager.instance.gameHeight | |
// inside the update function | |
transform.position = Vector3( Mathf.Repeat(myTransform.position.x, aWidth), Mathf.Repeat(myTransform.position.y, aHeight), 0) ; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment