vector to angle problem

SkyMapleSkyMaple Member Posts: 817
edited November -1 in Working with GS (Mac)
I have a problem with an actor that has the vector to angle expression on it. what the expression is telling it to do is to rotate toward touch. When touch is released I have the actor move toward the touch. the problem is when I have the actor move lets say to the right I touch the screen and the angle is facing AWAY from the touch. How can I fix this?

Comments

  • SkyMapleSkyMaple Member Posts: 817
    maybe this will help:

  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    You are prob using relative to actor instead of scene for your moves
  • SkyMapleSkyMaple Member Posts: 817
    On the arrow , i have a constrain to -vector to angle (selfpositionX-mouseX,selfpositionY-mouseY)
  • SkyMapleSkyMaple Member Posts: 817
    In otherwords i cant change the relitivity. Can anyone solve this?
  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    take out the "-" no need for it that I see
  • SkyMapleSkyMaple Member Posts: 817
    It doesnt work if i do that:

    image
  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    Try putting (self.position.x-mouseposition.x and self.position.y-mouseposition.y)
  • SkyMapleSkyMaple Member Posts: 817
    nope, that just inverts it. This is really bugging me, I can't figure it out?!?!?! :(
  • SkyMapleSkyMaple Member Posts: 817
    Could the problem be that the attributes are integer not real?
  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    yep that will likely cause issues. anytime there is a chance of decimals you need to use real. I don't know if it causing your problem but that could be it.
  • SkyMapleSkyMaple Member Posts: 817
    it wasn't. for some reason it doesnt get messed up until it gets to the other platform?
  • SkyMapleSkyMaple Member Posts: 817
    Its it possible for the vector to angle to get messed up after it gets to a certain part of the screen?
  • ValanValan Member, BASIC Posts: 410
    What is your screen size?

    It seems like the rotation is not taking into account the additional x locations.

    Try Rotating to
    game.Touches.Touch 1.X + scene.Camera.Origin.X
    And the y equivalent.

    The actor needs to be on the Scene Preview window to have access to the Scene attributes.

    Hope this works

    Cheers

    Valan
  • SkyMapleSkyMaple Member Posts: 817
    Valan said:
    What is your screen size?

    It seems like the rotation is not taking into account the additional x locations.

    Try Rotating to
    game.Touches.Touch 1.X + scene.Camera.Origin.X
    And the y equivalent.

    The actor needs to be on the Scene Preview window to have access to the Scene attributes.

    Hope this works

    Cheers

    Valan

    Thanks! thats what I missed, i forgot to include the camera offset!!

    YAY!
Sign In or Register to comment.