constrain attribute crashing game

dbokserdbokser Member Posts: 8
edited November -1 in Working with GS (Mac)
Hi. I'm trying to do something along the lines of the mini-map tutorial, but mine just prints out the x and y position of the player.

1. I created 2 game variables called PlayerPosX and PlayerPosY
2. I added Constrain Attributes for game.PlayerPosX to player.Position.X and game.PlayerPosY to player.Position.Y
3. I created another actor
4. I added 2 attributes to the second actor: posx and posy
5. I added Constrain Attribute for self.posx to game.PlayerPosX (and did the same for Y)
6. I added a Display Text and the text is self.posx
7. When I try and preview the game, I get a black screen or a crash.

Anybody know what's going on here?

Comments

  • dbokserdbokser Member Posts: 8
    dbokser said:
    Hi. I'm trying to do something along the lines of the mini-map tutorial, but mine just prints out the x and y position of the player.

    1. I created 2 game variables called PlayerPosX and PlayerPosY
    2. I added Constrain Attributes for game.PlayerPosX to self.Position.X and game.PlayerPosY to self.Position.Y
    3. I created another actor
    4. I added 2 attributes to the second actor: posx and posy
    5. I added Constrain Attribute for self.posx to game.PlayerPosX (and did the same for Y)
    6. I added a Display Text and the text is self.posx
    7. When I try and preview the game, I get a black screen or a crash.

    Anybody know what's going on here?

  • scitunesscitunes Member, Sous Chef Posts: 4,047
    did you constrain them in the right order? I once made the mistake of constraining self.position to my game attribute when it should have been the other way around. Only thing I can think of.
  • dbokserdbokser Member Posts: 8
    Yep, I checked them and did it exactly like the minimap tutorial
  • CodeMonkeyCodeMonkey Head Chef, Member, PRO Posts: 1,803
    Did you choose the attribute from the attribute browser, or did you manually type in everything?
  • dbokserdbokser Member Posts: 8
    chose the attribute from the browser
  • dbokserdbokser Member Posts: 8
    I changed it so that it's exactly like the minimap tutorial and the actor position itself changes, instead of changing an attribute inside the actor, and that seems to have made it work. Not exactly what I wanted but I guess I could live with it like this for now.
Sign In or Register to comment.