Left Right Without Platform Behavior

0 favourites
  • 10 posts
From the Asset Store
In this template the music plays without looping in your game
  • Left Right Without Platform Behavior

    I'm trying to make a gun turret that rotates from left to right by holding Ctrl and then left/right arrow (Got that working)

    Also when you release Ctrl it auto rotates back to the front firing position (Got that working)

    But I also want when Ctrl is not press but Left/Right is it moves left to right.

    How can I do this and is it possible to do it without adding the platform behavior to it so I don't have to deal with the jump or it falling to the bottom of the page?

    I'm surprised no one has made a plugin like for flying... Forward/Left/Right/Back. Just simple arrow commands instead of the 8 way just break it down to 4 or even the option for 2 (Left and Right only on the object) is there such a thing?

    I wish I had the skills to make one...

    Thanks you in advance.

  • You can just use 'move at angle'. 180 for left, 0 for right. And always remember to set the amount to move as a multiple of dt! (for example: 'left arrow is down' > 'turret move at angle 180, 260*dt').

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Tobye Thanks, and do I do the same for the right?

    Thanks for your help...

  • Checked out Walk Softly... I like it...

  • Yep! Same for any direction you want. Up-right corner is 315 degrees for example.

  • Tobye That works thanks just need to get the right going thanks again...

    Much appreciated

  • Tobye I appreciate your help and I'm not trying to get you to do my work because I like to learn on my own (At least try ti figure it out first). However, I'm not familiar with you equation so I'm coming back to you.

    Everything is moving fine except now when I hold Ctrl/left/right it not only rotates left/right but it move left/right as well.

    I want to do one or the other meaning Ctrl/left/right rotate turret in place or left/right move left/right.

    I'll figure out the auto fire and all that later...

    I'm using the rotate behavior as well if that makes a difference but I'm not seeing how to tell it to not move left/right when rotating left/right and vice-verse.

    Thank you for your time...

  • No problem! Just have another condition that says 'is CNTRL down', then right-click it and select 'invert'. This means the condition is only true if the CNTRL key is NOT pushed.

  • Thanks I will give that a try I do appreciate it.

  • YES!!!!!!!!!!!!!!!!!!!!!! Thank you... If you every write a book on this stuff I will buy it... :)


Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)