Plane stuck in one area.

axumgameaxumgame Member, PRO Posts: 22
edited June 2017 in Working with GS (Mac)

Please help, show me a photo or try explain this to me how to fix this.

I have two problems:
1. Actor not rotating to where i touch on the screen
2. Camera not following my plane.

I need help with the camera the most, if you have information on that only share it with me. PLEASE HELP!

Comments

  • IceboxIcebox Member Posts: 1,485
    edited June 2017

    You need to add scene.camera.origin.x and scene.camera.origin.y to the 2 constrains

    So it will be like this

    Constrain self.motion.linearvelocity x to touch1.x - self.position.x + scene.camera.origin.x

    Constrain self.motion.linearvelocity y to touch1.y - self.position.y + scene.camera.origin.y

    To make it rotate towards touch

    Constrain rotation to vectorToAngle(game.touch1.x - self.position.x + scene.camera.origin.x , game.touch1.y - self.position.y + scene.camera.origin.y)

    To access camera origin you will have to unlock the actor , but you can also create 2 real game attributes Cam.X , Cam.Y . add a new actor on the scene unlock it and constrain the 2 attributes to camera origin x and camera origin y like this.

    Constrain game.Cam.X to camera origin x
    Constrain game.Cam.Y to camera origin y

    this way you can access the camera origin without unlocking the main actor. You will just need to replace scene.camera.origin.x with Cam.X and scene.camera.origin.y with Cam.Y

    Hope this helps

  • axumgameaxumgame Member, PRO Posts: 22

    @Icebox how do i find scene.camera.origin.x?

    like what do i press on to make it pop up in blue highlighted text like the other stuff. I tried pressing on Game: It wasnt there .. Devices: it wasnt there .. and on Myactorname: it wasnt there ... I even typed it in physically it didnt recognize it

  • IceboxIcebox Member Posts: 1,485

    You need to unlock the actor , here is how to do it step by step

    You might need to change -90 to -180 based on your image direction , hope this helps

  • axumgameaxumgame Member, PRO Posts: 22

    Here is a clear video of what is happening @Icebox

  • IceboxIcebox Member Posts: 1,485

    Yes it might be confusing in the beginning cause you need to unlock the actor to access current scene attributes :# sorry i thought you knew that hope the video helps and good luck

  • SocksSocks London, UK.Member Posts: 12,822
    edited June 2017

    @axumgame said:
    Here is a clear video of what is happening @Icebox

    From what I can tell (looking at your expression windows) you have typed in the attributes 'Touch 1.X' and 'scene camera origin.X' (and the same for Y) instead of selecting these from the pulldown menu.

    You need to select them from the pulldown menu.

  • axumgameaxumgame Member, PRO Posts: 22

    @Icebox THANK YOU SO MUCH FOR THE VIDEO! ITS WORKING YOUR THE BEST FOR THIS ONE!

    One more question. How do I adjust the plane speed, just want it to go a bit slower.

  • IceboxIcebox Member Posts: 1,485
    edited June 2017

    @axumgame said:
    How do I adjust the plane speed, just want it to go a bit slower.

    I would replace all these constrains with move behavior

    if mouse button is down
    move
    direction = vectorToAngle(game.touch1.x - self.position.x + >scene.camera.origin.x , game.touch1.y - self.position.y + scene.camera.origin.y)-180

    relative to scene
    Speed =The value you want

  • IceboxIcebox Member Posts: 1,485
    edited June 2017

    ..

  • IceboxIcebox Member Posts: 1,485
    edited June 2017

    ..

  • mhedgesmhedges Raised on VCS Member Posts: 634
  • IceboxIcebox Member Posts: 1,485
    edited June 2017

    Apologies for the double post ! :# it got stuck while editing the comment

Sign In or Register to comment.