Problem with Rotate Actor - Video Include

RubiyoooRubiyooo Member Posts: 163
edited November -1 in Working with GS (Mac)
Hello i have a problem with my tank

I want that when i move my mouse for example , my turret rotate to my actual position ( mouse position)



Im am very noob with constrain attributes and position in angle behaviors.

All help will be received well :)

Comments

  • RumiRumi Member, PRO Posts: 343
    Are you having it vectortoangle to mouse position?
    Make sure its something like this:
    vectorToAngle(mouse.position.X-self.position.X,mouse.position.Y-self.position.Y)
    Or something like that!
    :)
  • RubiyoooRubiyooo Member Posts: 163
    I do not undestand Rumi

    Here a image http://dl.dropbox.com/u/6352083/duda.jpg

    But when you say me vectorToAngle, i don´t find any behavior with that attribute. I do not know if i need to build a constrain attribute or create a rule. And then where to write (mouse.position.X-self.position.X,mouse.position.Y-self.position.Y)

    Because for me is it very hard for me now.
    What do you mean with "mouse.positionX- self.positionX"
    I look that in other posts but i don´t understand what to do

    Regards
  • RubiyoooRubiyooo Member Posts: 163
    i do not understand nothing. The picture is the turrets and it is pointing to the right :O
  • BrynjeBamsenBrynjeBamsen Member Posts: 188
    Send me the file and ill fix it for you - and.oestergaard@gmail.com
  • RubiyoooRubiyooo Member Posts: 163
    i p
    BrynjeBamsen said:
    Send me the file and ill fix it for you - and.oestergaard@gmail.com
    refer to learn and understand it here ;)
  • BrynjeBamsenBrynjeBamsen Member Posts: 188
    The otherway is just easier.... but okay.

    When we say "self" we mean the actor you're editing.

    In your case:

    Contrain attribute
    Game.tanker.rotate TO VectorToAngle(game.mouse.position.X-tanker.position.X,game.mouse.position.Y-tanker.position.Y)

    Dont use "rotate to position"

    Secondly: You need to change your image. cause gamesalad on rotates around center. so you need to extend the space behind the turret så i look like it rotate currectly....

    Like i said earlier... i will gladly take a look at it. its always easier learn by its done right the first time.
  • RubiyoooRubiyooo Member Posts: 163
    Do not works BrynjeBamsen :(

    http://imageshack.us/f/89/sinttulotw.jpg

    And i do not understand why "game.mouse.position.X-tanker.position.X" what is it the end?
  • UtopianGamesUtopianGames Member Posts: 5,692
    I think the problem is with the image, you want it to rotate from the turret so you will need some blank space...let me try and show you..

    http://www.utopiangames.co.uk/gamesalad/Help.png

    Darren.
  • RubiyoooRubiyooo Member Posts: 163
    Sorry but does not work again I modify my image how UtopianGames and Tshirtbooth say but nothing. Here a example http://dl.dropbox.com/u/6352083/TEST.jpg

    I think that i fall i the Constrain Attribute

    self.Rotation

    to

    vectorToAngle( self.Position.X - game.Mouse.Position.X , self.Position.Y - game.Mouse.Position.Y )

    I need a noob class about what it mean (anything.x-anything.x,anything.y-anything.y)

    And Thanks everyone for their patience
Sign In or Register to comment.