8 direction movement with smoother rotation

0 favourites
  • 4 posts
From the Asset Store
Rotate & Animation for 16 Direction & Mouse Direction
  • Hi guys!

    I added some events for 8dir rotation

    For example

    When The "W" key is down Player will rotate 2 degrees toward 270 angle

    But the problem is that for example when the player angel is 90 and I Press "W" with "D" the player rotate more than 2 degrees(faster) toward 315 angle

    But I defined to rotate 2 degrees toward 315 angle

    .CAPX file

    i will be grateful if you guys help me

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • All of your events are firing together. There is no condition to stop the individual button events firing at the same time as the multi-button events. E.I. - When you press W and D, the event for just W, just D and both W and D all fire causing your character to rotate for all these events at the same time. There are definitely better ways to handle this but given the events you have, if you just order them this way (notice the else statement which ensures the events won't fire over each other) you should see the result you are looking for.

    Put the double key events first so the single key events don't get caught first and block them.

  • Scratch my previous post and just do this:

    As I said, there are better ways to handle what you are doing and I didn't plan looking into it further but decided I'd just play with it for a second. That last event should do the rotation part of what you are trying to do with all the button press events you had.

  • Thanks!!!!🤝

    Actually your previous post helped me and I fixed the problem.

    But as you mentioned ,that is a really good way to do that

    I will be thankful if you gave me any ideas to this in a better way.

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