Rotating Character

Hello Guys! This is my first post but i have been using GameSalad the last few months and I have finally seem to have got myself stuck. Seems like a very simple thing to do but cannot figure out how.

I am creating a game using a plane and its the old click and hold to rise up and release to go down.

Now my problem is when i click and hold i want the plane to curve up a little to indicate it is rising and when i release i want the plane to curve down. I already got the plane to go up and down but just need help like rotating the plane up and down. I tried using the rotate to angle but it makes the plane go all over the place. Any help is appreciated. Thank you!

Comments

  • Loranzo23Loranzo23 Member Posts: 12

    Forgot to add its going from Left to Right just to give you guys a better idea. Thank you!

  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772

    If you're using a Move Behavior to move it up/ down you should choose Relative to Scene instead of Relative to Actor.

  • Loranzo23Loranzo23 Member Posts: 12

    I tried that and also different combinations. I can get my plane to up and down without a problem its just that when it goes up I dont want it to simply to go up I want the plane actor to rotate/tilt a little up to indicate that the plane is rising and then rotate/tilt a little down to indicate its going down. Thats what im asking how to do. Thank you.

    @jamie_c said:
    If you're using a Move Behavior to move it up/ down you should choose Relative to Scene instead of Relative to Actor.

  • gamestudentgamestudent Member Posts: 504
    edited June 2014

    What you need to do is create a actor attribute. click the + symbol in the pane on the left inside your actor and select angle. name it something like myangle.
    Now for the logic.
    drag a constrain attribute in and leave it outside of any rules.

    It should look like this:

    Constrain attribute self. rotation to self.myangle

    Now in your rule that determines the upward movement create a change attribute like this:

    when mouse button is down:

    Change attribute: Self.myangle to: 45(or whatever angle you want it to be.)

    move up behavior

    Otherwise:

    Change attribute: self.myangle to: 315(or whatever angle you want it to be.)

    move down behavior

    That should do it!
    Good luck,
    ~Gamestudent

  • Loranzo23Loranzo23 Member Posts: 12

    Thank you for the reply. Okay now that did work but now the plane is moving to the left and eventually gets off screen. Would it be possible to have those angle movements without the actor actually moving to the left of the screen. I wanna have those exact movements but with the plane actor only going up and down and not moving to the left of the screen which eventually fades off.

    So far we got the plane to go up and down and also with your angle movement look proper just figuring out the actor going off the screen.

    Thank you so much for your reply!!

    @gamestudent said:
    What you need to do is create a actor attribute. click the + symbol in the pane on the left inside your actor and select angle. name it something like myangle.
    Now for the logic.
    drag a constrain attribute in and leave it outside of any rules.

    It should look like this:

    Constrain attribute self. rotation to self.myangle

    Now in your rule that determines the upward movement create a change attribute like this:

    when mouse button is down:

    Change attribute: Self.myangle to: 45(or whatever angle you want it to be.)

    move up behavior

    Otherwise:

    Change attribute: self.myangle to: 315(or whatever angle you want it to be.)

    move down behavior

    That should do it!
    Good luck,
    ~Gamestudent

  • gamestudentgamestudent Member Posts: 504

    I think all you have to do is change the movment to relative to scene.

  • Loranzo23Loranzo23 Member Posts: 12

    YOU ARE THE BEST! Thank you so much!!! Sitting here laughing at myself playing with the acceleration when all i needed to do was make it relative to scene! haha THANK YOU! again!

    @gamestudent said:
    I think all you have to do is change the movment to relative to scene.

  • gamestudentgamestudent Member Posts: 504

    Your welcome. :smiley:

Sign In or Register to comment.