HUD compass

obsoleteentertainmentobsoleteentertainment Member, PRO Posts: 21
edited November -1 in Working with GS (Mac)
Hello,

can anybody point me into the direction to make a hud compass which points to a non movable actor in a scrolling scene environment...

Comments

  • pyrosmileypyrosmiley Member Posts: 8
    inside Objective actor
    +Constrain Attribute Behavior
    Constrain Attribute: game.objectiveX
    to: self.position.X
    +Constrain Attribute Behavior#2
    Constrain Attribute: game.objectiveY
    to: self.position.Y

    inside Compass actor
    +Constrain Attribute Behavior
    Constrain Attribute: self.rotation
    to: vectorToAngle(game.objectiveX-self.position.X, game.objectiveY-self.position.Y)

    Depending on if your compass is originally pointing up or down, you may need to add +90 or -90 at the end of the last expression
  • obsoleteentertainmentobsoleteentertainment Member, PRO Posts: 21
    when i do this the compass on the hud layer rotates some degress and points to the objective but i do have a player actor which is moving through the level. So the compass should constantly update somehow?!
  • pyrosmileypyrosmiley Member Posts: 8
    Are you using constrain attributes or change attribute? if so then try constraining your compass to a point on the camera itself rather than using a whole new layer
Sign In or Register to comment.