Help with Mouse.Position.X and Y with scrollable screens

I have the camera fixed on an actor, who can move in an area 2x the width of the camera.
The actor's head, which is a separate actor, rotates depending on the mouse position (so the head faces where the mouse is)
When i do not move the actor, this works perfectly.
However, when i move the actor towards the area (camera scrolls slightly), the angles seem to be wrong
I am doing this to get the angle: vectorToAngle( game.Mouse.Position.X - self.Position.X , game.Mouse.Position.Y - self.Position.Y )

Any help would be appreciated!

Comments

  • UtopianGamesUtopianGames Member Posts: 5,692
    Have you tried unlocking the actor and adding the scene.camera.origins X & Y to the mouse positions?

    Sounds like it should work.

    Darren.
  • SunnySunny Member Posts: 12
    Hey, thanks for the reply. Are you saying unlocking the camera from the actor? Also i cannot find scene.camera.origins
  • UtopianGamesUtopianGames Member Posts: 5,692
    Double click on the actor in the scene to unlock it then you can access the scene layers where the camera origin is.

    Darren.
  • SunnySunny Member Posts: 12
    Thank you! Yes that fixed the problem! Last question:
    If i unlock an actor, and I want to make changes (like add a rule), should i do this by double clicking the actor in the scene, or using the actor in the inspector? I'm afraid it may lead to inconsistencies in the future
Sign In or Register to comment.