How can i make an actor fall according to the camera's rotation

AportolGamesAportolGames Member Posts: 26
edited February 2013 in Working with GS (Mac)
So I've been working on a 2d game and i want the actor to fall according to the camera's rotation any idea on how to do that ?

Best Answer

«1

Answers

  • SocksSocks London, UK.Member Posts: 12,822
    How are you rotating the camera ?
  • AportolGamesAportolGames Member Posts: 26
    How are you rotating the camera ?
    I made an Boolean attribute and called it Rotate Camera then i made 2 actors in the first one i made a rule when touch is pressed constrain attribute rotate camera to true then put the 2nd actor on to the scene and create a rule when attribute game.rotate camera is true constrain attribute scene.camera.rotation to scene.camera.rotation+1
  • SocksSocks London, UK.Member Posts: 12,822
    For the actors that you want to fall give it an accelerate behaviour and make the direction of acceleration scene.camera.rotation -90

    Pretty sure that's right, might need to check it when I am able to get to my computer later.
  • AportolGamesAportolGames Member Posts: 26
    For the actors that you want to fall give it an accelerate behaviour and make the direction of acceleration scene.camera.rotation -90
    Pretty sure that's right, might need to check it when I am able to get to my computer later.
    This is what i did from the beginning but when i rotate the camera to the right it goes to the left and when i rotate the camera to the left it goes to the right
  • SocksSocks London, UK.Member Posts: 12,822
    edited February 2013

    This is what i did from the beginning but when i rotate the camera to the right it goes to the left and when i rotate the camera to the left it goes to the right
    Too ambiguous for me.
  • AportolGamesAportolGames Member Posts: 26

    This is what i did from the beginning but when i rotate the camera to the right it goes to the left and when i rotate the camera to the left it goes to the right
    Too ambiguous for me.
    What I'm trying to say is that it's not working for me any other idea on how to make it work
  • SocksSocks London, UK.Member Posts: 12,822
    edited February 2013

    What I'm trying to say is that it's not working for me any other idea on how to make it work
    The method I posted above should work fine.
  • AportolGamesAportolGames Member Posts: 26

    What I'm trying to say is that it's not working for me any other idea on how to make it work
    The method I posted above should work fine.
    Does not work for me. When I rotate the camera to the right the actor goes to the left

  • SocksSocks London, UK.Member Posts: 12,822

    Does not work for me. When I rotate the camera to the right the actor goes to the left
    Where do you want the actor to go ?

  • AportolGamesAportolGames Member Posts: 26

    Does not work for me. When I rotate the camera to the right the actor goes to the left
    Where do you want the actor to go ?

    Watch this vides

    i dont want to to go flying i want to to come down
  • SocksSocks London, UK.Member Posts: 12,822


    Watch this vides

    i dont want to to go flying i want to to come down
    When you rotate the camera to the right where do you want the actor to go ?


  • AportolGamesAportolGames Member Posts: 26


    Watch this vides

    i dont want to to go flying i want to to come down
    When you rotate the camera to the right where do you want the actor to go ?


    to the left
  • AportolGamesAportolGames Member Posts: 26


    Watch this vides

    i dont want to to go flying i want to to come down
    When you rotate the camera to the right where do you want the actor to go ?


    or in other words if the camera is rotating clockwise i want the actor to fall to the right

  • SocksSocks London, UK.Member Posts: 12,822

    to the left
    All you have to do is to adjust the direction of the falling actor's accelerate behaviour.
  • SocksSocks London, UK.Member Posts: 12,822

    or in other words if the camera is rotating clockwise i want the actor to fall to the right
    I think that should read 'left' ?
  • AportolGamesAportolGames Member Posts: 26

    or in other words if the camera is rotating clockwise i want the actor to fall to the right
    I think that should read 'left' ?
    its not working the way i want it to
  • AportolGamesAportolGames Member Posts: 26

    or in other words if the camera is rotating clockwise i want the actor to fall to the right
    I think that should read 'left' ?
    Watch this video
  • ElfizmElfizm Member Posts: 489
    Your saying you want it left and then right. So confusing :((
  • AportolGamesAportolGames Member Posts: 26
    Your saying you want it left and then right. So confusing :((
    Watch the video

  • ElfizmElfizm Member Posts: 489
    Just change the direction to opposite, so if it's 500 change it to -500.

    That's my bet because it's just doing the opposite.
  • AportolGamesAportolGames Member Posts: 26

    Watch the video
    Please
    i have it on 90 but when i put it to 90 the screen goes black
  • AportolGamesAportolGames Member Posts: 26

    Watch the video
    Please
  • SocksSocks London, UK.Member Posts: 12,822
    edited February 2013

    Watch this video
    Good grief this is getting confusing, you say "if the camera is rotating clockwise i want the actor to fall to the right" - but in the video the camera rotates counterclockwise and you have a red arrow pointing to the right saying you want the actor to fall this way ?

    You can get the actor to move in whichever direction you want in relation to the camera by adjusting the direction in the accelerate behaviour.
  • AportolGamesAportolGames Member Posts: 26

    Watch this video
    Good grief this is getting confusing, you say "if the camera is rotating clockwise i want the actor to fall to the right" - but in the video the camera rotates counterclockwise and you have a red arrow pointing to the right saying you want the actor to fall this way ?


    i want it just like the video
  • SocksSocks London, UK.Member Posts: 12,822
    edited February 2013

    i have it on 90 but when i put it to 90 the screen goes black
    That might be the most mysterious post yet ! :((

    It really takes a tiny amount of extra effort to state your terms, personally I try to avoid words like 'it' when there is more than one element involved.

    "When I rotate the camera the actor rotates in the opposite detection" . . . . is useful.

    "When I rotate it it 'goes' the wrong way" . . . . is less useful.
  • AportolGamesAportolGames Member Posts: 26

    i have it on 90 but when i put it to 90 the screen goes black
    That might be the most mysterious post yet ! :((

    It really takes a tiny amount of extra effort to state your terms, personally I try to avoid words like 'it' when there is more than one element involved.

    "When I rotate the camera the actor rotates in the opposite detection" is useful.

    "When I rotate it it doesn't work" is less useful.
    Great so now you understand what i need right ?
  • SocksSocks London, UK.Member Posts: 12,822
    If you want to upload your project (or just the part you are trying to sort out) I'm sure someone can sort it out for you fairly quickly.
  • AportolGamesAportolGames Member Posts: 26
    If you want to upload your project (or just the part you are trying to sort out) I'm sure someone can sort it out for you fairly quickly.
    This is the Project File
    http://www.sendspace.com/file/bqec2l
  • SocksSocks London, UK.Member Posts: 12,822

    Great so now you understand what i need right ?
    No, my post was highlighting that I found it hard to understand.
Sign In or Register to comment.