GameSalad

Plane stuck in one area.

axumgameaxumgame Posts: 22Member, PRO
edited June 15 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 Posts: 1,434Member, PRO
    edited June 14

    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 Posts: 22Member, PRO

    @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 Posts: 1,434Member, PRO

    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 Posts: 22Member, PRO

    Here is a clear video of what is happening @Icebox

  • IceboxIcebox Posts: 1,434Member, PRO

    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.Posts: 12,725Member
    edited June 15

    @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 Posts: 22Member, PRO

    @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 Posts: 1,434Member, PRO
    edited June 15

    @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 Posts: 1,434Member, PRO
    edited June 15

    ..

  • IceboxIcebox Posts: 1,434Member, PRO
    edited June 15

    ..

  • mhedgesmhedges Raised on VCS Posts: 633Member, PRO

    United?

  • IceboxIcebox Posts: 1,434Member, PRO
    edited June 15

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

Sign In or Register to comment.