rotation to Angle of another actor retaining his position

zamorayszamorays Member Posts: 11
edited November -1 in Working with GS (Mac)
Hey guys, I'm impressed with the forum's,and encourage me to write and I'm stuck with my actors, I need the roll canon pointing to another while retaining his position actor who is moving around the scene,es decir que lo apunte sin cambiar la posicion solo que gire hacia donde se mueva...
Thanks for your answers

Comments

  • zamorayszamorays Member Posts: 11
    Hey guys, I'm impressed with the forum's,and encourage me to write and I'm stuck with my actors, I need the roll canon pointing to another while retaining his position actor who is moving around the scene,the point is that without changing the position only to turn to where to move ...
    Thanks for your answers
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    Hey There.

    First off you want to create 4 real attributes. Call them canonbaseX and canonbaseY , enemyX and enemyY(or whatever you want)

    In the enemy you want the canon to rotate towards have 2 constrain attribute behaviors and constrain attribute enemyX to self position X and constrain attribute enemy Y to self position y

    In the position actor who moves around, constrain attribute canonbaseX to self.position.X and constrain attribute canonbaseY to self position Y

    Now in the top part of the canon you want to rotate constrain attribute self position x to canonbase x and constrain attribute self position y to canonbaseY

    That will have it move around with it.

    Then finally have another constrain attribute behavior in there and constrain attribute self rotation top vectorToAngle(self.position.x-enemy.x,self.position.y-enemy.y)

    or you can use a rotate to position behavior and rotates towards the enemyX and enemyY attributes

    Hope that helps
  • zamorayszamorays Member Posts: 11
    ((Now in the top part of the canon you want to rotate first constrain attribute self position x to canonbase x and constrain attribute self position y to canonbaseY))

    and in the top of the canon, I could spell that please...???
    Thanks for your quick response .......
  • zamorayszamorays Member Posts: 11
    Hi...
    Help I try to do that, but i don't now where and which orden...

    Thanks....
Sign In or Register to comment.