Question: I'm trying to make a sprite "comet" appear at a random position at random times. So far, I wanted to test if my random position code works, however, I can't seem to even see the sprite. This is my code: 

```
 func spawnAtRandomPosition() {
        let height = self.view!.frame.height
        let width = self.view!.frame.width

        let randomPosition = CGPointMake(CGFloat(arc4random()) % height, CGFloat(arc4random()) % width)

        let sprite = SKSpriteNode(imageNamed: "comet")
        sprite.position = randomPosition
        self.addChild(sprite)
    }

```

As I said, I'm not seeing **anything**. Any help? If you already know how to make it appear at a random time that would be appreciated as well, because that's having problems of its own, however this is my focus right now. Thanks!

Answer: 
Your code for setting the random position is incorrect. Additionally, your code has issues that should make it impossible to compile in Swift 3. Your full function should look like this:

```
func spawnAtRandomPosition() {
        let height = UInt32(self.size.height)
        let width = UInt32(self.size.width)

        let randomPosition = CGPoint(x: Int(arc4random_uniform(width)), y: Int(arc4random_uniform(height)))

        let sprite = SKSpriteNode(imageNamed: "comet")
        sprite.position = randomPosition
        self.addChild(sprite)
    }

```

Note the changes to `randomPosition` and the height and width:

```
let randomPosition = CGPoint(x: Int(arc4random_uniform(width)), y: Int(arc4random_uniform(height)))

```

This determines a random value between 0 and your width and does the same thing for the height. 

As for the height and width, see @Whirlwind's comment on the question explaining the difference between the view and the scene.

Additionally, you may want to check if you're setting up your node properly (set size, try with fixed location, etc) before you test the random positioning, to determine where the problem truly lies.
I came up with this bit of code and it works for me:

```
    let randomNum = CGPoint(x:Int (arc4random() % 1000), y: 1)

    let actionMove =  SKAction.moveTo(randomNum, duration: 1)

```

I only wanted the x to be randomized, however if you need "y" to be randomized as well, you can just copy the specification to x to y.