How do I get this vibration ironed out?

  • So im trying to get this top down shooter off the ground and im trying to create a two part player body that you control the legs and upper body with different inputs. After a couple of ideas from the wonderful community, i got it to work really nice...execpt for the fact that the upper body now starts to vibrate after it reaches a certain angle value since it's coded to move to the direcion the lowerbody is pointing is it passes the set rotation limit. Could i maybe stop the mouse cursor that moves the upper body from moving over the set angle limit? or how can i stop the upper body from not going over the set angle? one thing i tried was to slow the turn angle rate to something small like 1 (its now at 10) so it wont jump so much over the set limit and would return fairly quick, but this has the dowside of making the turn movement uselessly slow.

    capx :

    https://dl.dropboxusercontent.com/u/73502848/turnshakes.capx[/code:f7knrxt1]
  • Here's one without shaking:

    https://dl.dropboxusercontent.com/u/485 ... kes-1.capx

    You're biggest problem is when the "tank" changes direction it does so almost instantaniously, so the "top" has no time to adjust (rotate towards) a possible angle.

    you might want to add an action on direction changed (or key-press to make direction change) setting the angle of the top.

  • This is the best I can come up with for now..

    Not perfect, but pretty nice, if I may say so myself..

    https://dl.dropboxusercontent.com/u/485 ... ution.capx

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • that was it. Thats exactly what i was looking for, just didnt know how to do it It actually still bugs out a bit for some reason if you fiddle with it,the top part gets stuck for some reason sometimes, but this works for me though.

    Thats a great example to make it a "tank-like" movement, my guy is going to be a soldier so cant have that clunky movement going on

    my sincerest thank you!

  • that was it. Thats exactly what i was looking for, just didnt know how to do it It actually still bugs out a bit for some reason if you fiddle with it,the top part gets stuck for some reason sometimes, but this works for me though.

    Thats a great example to make it a "tank-like" movement, my guy is going to be a soldier so cant have that clunky movement going on

    my sincerest thank you!

    Yeah, there is still a lot that can be optimized, but this is a good step in the right direction..

    What do you mean with clunky movement?

    increasing the clockwise rotationspeed will take away the slow turn, but keep some kind of turn instead of changing directions instantly..

    I think it looks perfect for a soldier at 22.5 degrees every tick (but ofcourse these are estethics)..

  • i just mean that right now it has only those four movement directions, prolly will get only better if ill add another four directions to make the movement more fluid. But yeah, all in all thats beautiful!

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